comment
stringlengths
1
45k
method_body
stringlengths
23
281k
target_code
stringlengths
0
5.16k
method_body_after
stringlengths
12
281k
context_before
stringlengths
8
543k
context_after
stringlengths
8
543k
I'll add comments as we'll want to keep this once the issue is resolved in the lower levels as it'll allow us to reintroduce performance improvements.
public Mono<Void> writeValueToAsync(AsynchronousByteChannel channel, ProgressReporter progressReporter) { Objects.requireNonNull(channel, "'channel' must not be null"); if (super.getValue() != null) { return FluxUtil.writeToAsynchronousByteChannel( FluxUtil.addProgressReporting(super.getValue(), progressReporter), chan...
public Mono<Void> writeValueToAsync(AsynchronousByteChannel channel, ProgressReporter progressReporter) { Objects.requireNonNull(channel, "'channel' must not be null"); if (super.getValue() != null) { return FluxUtil.writeToAsynchronousByteChannel( FluxUtil.addProgressReporting(super.getValue(), progressReporter), chan...
class BlobDownloadAsyncResponse extends ResponseBase<BlobDownloadHeaders, Flux<ByteBuffer>> implements Closeable { static { BlobDownloadAsyncResponseConstructorProxy.setAccessor(BlobDownloadAsyncResponse::new); } private static final ByteBuffer EMPTY_BUFFER = ByteBuffer.allocate(0); private final StreamResponse sourceR...
class BlobDownloadAsyncResponse extends ResponseBase<BlobDownloadHeaders, Flux<ByteBuffer>> implements Closeable { static { BlobDownloadAsyncResponseConstructorProxy.setAccessor(BlobDownloadAsyncResponse::new); } private static final ByteBuffer EMPTY_BUFFER = ByteBuffer.allocate(0); private final StreamResponse sourceR...
This should be defined as a constant
private Object createFeature(FeatureFlagConfigurationSetting item) { String key = getFeatureSimpleName(item); String requirementType = "Any"; try { JsonNode node = CASE_INSENSITIVE_MAPPER.readTree(item.getValue()); JsonNode conditions = node.get("conditions"); if (conditions != null && conditions.get("requirement_type"...
String requirementType = "Any";
private Object createFeature(FeatureFlagConfigurationSetting item) { String key = getFeatureSimpleName(item); String requirementType = DEFAULT_REQUIREMENT_TYPE; try { JsonNode node = CASE_INSENSITIVE_MAPPER.readTree(item.getValue()); JsonNode conditions = node.get("conditions"); if (conditions != null && conditions.get...
class AppConfigurationFeatureManagementPropertySource extends AppConfigurationPropertySource { private static final ObjectMapper CASE_INSENSITIVE_MAPPER = JsonMapper.builder() .configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true).build(); private final List<ConfigurationSetting> featureConfigurationSetting...
class AppConfigurationFeatureManagementPropertySource extends AppConfigurationPropertySource { private static final ObjectMapper CASE_INSENSITIVE_MAPPER = JsonMapper.builder() .configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true).build(); private final List<ConfigurationSetting> featureConfigurationSetting...
something like DEFAULT_REQUIREMENT_TYPE
private Object createFeature(FeatureFlagConfigurationSetting item) { String key = getFeatureSimpleName(item); String requirementType = "Any"; try { JsonNode node = CASE_INSENSITIVE_MAPPER.readTree(item.getValue()); JsonNode conditions = node.get("conditions"); if (conditions != null && conditions.get("requirement_type"...
String requirementType = "Any";
private Object createFeature(FeatureFlagConfigurationSetting item) { String key = getFeatureSimpleName(item); String requirementType = DEFAULT_REQUIREMENT_TYPE; try { JsonNode node = CASE_INSENSITIVE_MAPPER.readTree(item.getValue()); JsonNode conditions = node.get("conditions"); if (conditions != null && conditions.get...
class AppConfigurationFeatureManagementPropertySource extends AppConfigurationPropertySource { private static final ObjectMapper CASE_INSENSITIVE_MAPPER = JsonMapper.builder() .configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true).build(); private final List<ConfigurationSetting> featureConfigurationSetting...
class AppConfigurationFeatureManagementPropertySource extends AppConfigurationPropertySource { private static final ObjectMapper CASE_INSENSITIVE_MAPPER = JsonMapper.builder() .configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true).build(); private final List<ConfigurationSetting> featureConfigurationSetting...
nit: Should we consider define this property name `requirement_type` as a constant as well?
private Object createFeature(FeatureFlagConfigurationSetting item) { String key = getFeatureSimpleName(item); String requirementType = "Any"; try { JsonNode node = CASE_INSENSITIVE_MAPPER.readTree(item.getValue()); JsonNode conditions = node.get("conditions"); if (conditions != null && conditions.get("requirement_type"...
if (conditions != null && conditions.get("requirement_type") != null) {
private Object createFeature(FeatureFlagConfigurationSetting item) { String key = getFeatureSimpleName(item); String requirementType = DEFAULT_REQUIREMENT_TYPE; try { JsonNode node = CASE_INSENSITIVE_MAPPER.readTree(item.getValue()); JsonNode conditions = node.get("conditions"); if (conditions != null && conditions.get...
class AppConfigurationFeatureManagementPropertySource extends AppConfigurationPropertySource { private static final ObjectMapper CASE_INSENSITIVE_MAPPER = JsonMapper.builder() .configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true).build(); private final List<ConfigurationSetting> featureConfigurationSetting...
class AppConfigurationFeatureManagementPropertySource extends AppConfigurationPropertySource { private static final ObjectMapper CASE_INSENSITIVE_MAPPER = JsonMapper.builder() .configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true).build(); private final List<ConfigurationSetting> featureConfigurationSetting...
Why it's underscore in requirement_type, but in the pojo it's requirement-type?
private Object createFeature(FeatureFlagConfigurationSetting item) { String key = getFeatureSimpleName(item); String requirementType = "Any"; try { JsonNode node = CASE_INSENSITIVE_MAPPER.readTree(item.getValue()); JsonNode conditions = node.get("conditions"); if (conditions != null && conditions.get("requirement_type"...
if (conditions != null && conditions.get("requirement_type") != null) {
private Object createFeature(FeatureFlagConfigurationSetting item) { String key = getFeatureSimpleName(item); String requirementType = DEFAULT_REQUIREMENT_TYPE; try { JsonNode node = CASE_INSENSITIVE_MAPPER.readTree(item.getValue()); JsonNode conditions = node.get("conditions"); if (conditions != null && conditions.get...
class AppConfigurationFeatureManagementPropertySource extends AppConfigurationPropertySource { private static final ObjectMapper CASE_INSENSITIVE_MAPPER = JsonMapper.builder() .configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true).build(); private final List<ConfigurationSetting> featureConfigurationSetting...
class AppConfigurationFeatureManagementPropertySource extends AppConfigurationPropertySource { private static final ObjectMapper CASE_INSENSITIVE_MAPPER = JsonMapper.builder() .configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true).build(); private final List<ConfigurationSetting> featureConfigurationSetting...
`requirement_type` comes from app configuration but `requirement-type` would be how Spring expects it when mapping configurations.
private Object createFeature(FeatureFlagConfigurationSetting item) { String key = getFeatureSimpleName(item); String requirementType = "Any"; try { JsonNode node = CASE_INSENSITIVE_MAPPER.readTree(item.getValue()); JsonNode conditions = node.get("conditions"); if (conditions != null && conditions.get("requirement_type"...
if (conditions != null && conditions.get("requirement_type") != null) {
private Object createFeature(FeatureFlagConfigurationSetting item) { String key = getFeatureSimpleName(item); String requirementType = DEFAULT_REQUIREMENT_TYPE; try { JsonNode node = CASE_INSENSITIVE_MAPPER.readTree(item.getValue()); JsonNode conditions = node.get("conditions"); if (conditions != null && conditions.get...
class AppConfigurationFeatureManagementPropertySource extends AppConfigurationPropertySource { private static final ObjectMapper CASE_INSENSITIVE_MAPPER = JsonMapper.builder() .configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true).build(); private final List<ConfigurationSetting> featureConfigurationSetting...
class AppConfigurationFeatureManagementPropertySource extends AppConfigurationPropertySource { private static final ObjectMapper CASE_INSENSITIVE_MAPPER = JsonMapper.builder() .configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true).build(); private final List<ConfigurationSetting> featureConfigurationSetting...
`setCosmosE2EOperationRetryPolicyConfig` to `setCosmosEndToEndOperationRetryPolicyConfig`
public void clientLevelEndToEndTimeoutPolicyInOptionsShouldTimeout() { if (getClientBuilder().buildConnectionPolicy().getConnectionMode() != ConnectionMode.DIRECT) { throw new SkipException("Failure injection only supported for DIRECT mode"); } CosmosClientBuilder builder = new CosmosClientBuilder() .endpoint(TestConfi...
.setCosmosE2EOperationRetryPolicyConfig(
public void clientLevelEndToEndTimeoutPolicyInOptionsShouldTimeout() { if (getClientBuilder().buildConnectionPolicy().getConnectionMode() != ConnectionMode.DIRECT) { throw new SkipException("Failure injection only supported for DIRECT mode"); } CosmosClientBuilder builder = new CosmosClientBuilder() .endpoint(TestConfi...
class EndToEndTimeOutValidationTests extends TestSuiteBase { private static final int DEFAULT_NUM_DOCUMENTS = 100; private static final int DEFAULT_PAGE_SIZE = 100; private CosmosAsyncContainer createdContainer; private final Random random; private final List<TestObject> createdDocuments = new ArrayList<>(); private fi...
class EndToEndTimeOutValidationTests extends TestSuiteBase { private static final int DEFAULT_NUM_DOCUMENTS = 100; private static final int DEFAULT_PAGE_SIZE = 100; private CosmosAsyncContainer createdContainer; private final Random random; private final List<TestObject> createdDocuments = new ArrayList<>(); private fi...
Unfortunately, I told you the wrong format. If either are set there will need to be `extractive|<option>` but if both are set the format is `extractive|<option 1>,<option 2>`, not `extractive|<option 1>|<option 2>`.
static String createSearchRequestAnswers(SearchOptions searchOptions) { QueryAnswerType answer = searchOptions.getAnswers(); Integer answersCount = searchOptions.getAnswersCount(); Double answerThreshold = searchOptions.getAnswerThreshold(); if (answer == null) { return null; } String answerString = answer.toString(); ...
if (answersCount != null) {
static String createSearchRequestAnswers(SearchOptions searchOptions) { QueryAnswerType answer = searchOptions.getAnswers(); Integer answersCount = searchOptions.getAnswersCount(); Double answerThreshold = searchOptions.getAnswerThreshold(); if (answer == null) { return null; } String answerString = answer.toString(); ...
class converts to. * @param selectedFields List of field names to retrieve for the document; Any field not retrieved will have null or * default as its corresponding property value in the returned object. * @return a response containing the document object * @see <a href="https: */ @ServiceMethod(returns = ReturnType.S...
class converts to. * @param selectedFields List of field names to retrieve for the document; Any field not retrieved will have null or * default as its corresponding property value in the returned object. * @return a response containing the document object * @see <a href="https: */ @ServiceMethod(returns = ReturnType.S...
I'd make this one big if/else if/else block where all conditional blocks return
static String createSearchRequestAnswers(SearchOptions searchOptions) { QueryAnswerType answer = searchOptions.getAnswers(); Integer answersCount = searchOptions.getAnswersCount(); Double answerThreshold = searchOptions.getAnswerThreshold(); if (answer == null) { return null; } String answerString = answer.toString(); ...
return answerString;
static String createSearchRequestAnswers(SearchOptions searchOptions) { QueryAnswerType answer = searchOptions.getAnswers(); Integer answersCount = searchOptions.getAnswersCount(); Double answerThreshold = searchOptions.getAnswerThreshold(); if (answer == null) { return null; } String answerString = answer.toString(); ...
class converts to. * @param selectedFields List of field names to retrieve for the document; Any field not retrieved will have null or * default as its corresponding property value in the returned object. * @return a response containing the document object * @see <a href="https: */ @ServiceMethod(returns = ReturnType.S...
class converts to. * @param selectedFields List of field names to retrieve for the document; Any field not retrieved will have null or * default as its corresponding property value in the returned object. * @return a response containing the document object * @see <a href="https: */ @ServiceMethod(returns = ReturnType.S...
Done
static String createSearchRequestAnswers(SearchOptions searchOptions) { QueryAnswerType answer = searchOptions.getAnswers(); Integer answersCount = searchOptions.getAnswersCount(); Double answerThreshold = searchOptions.getAnswerThreshold(); if (answer == null) { return null; } String answerString = answer.toString(); ...
return answerString;
static String createSearchRequestAnswers(SearchOptions searchOptions) { QueryAnswerType answer = searchOptions.getAnswers(); Integer answersCount = searchOptions.getAnswersCount(); Double answerThreshold = searchOptions.getAnswerThreshold(); if (answer == null) { return null; } String answerString = answer.toString(); ...
class converts to. * @param selectedFields List of field names to retrieve for the document; Any field not retrieved will have null or * default as its corresponding property value in the returned object. * @return a response containing the document object * @see <a href="https: */ @ServiceMethod(returns = ReturnType.S...
class converts to. * @param selectedFields List of field names to retrieve for the document; Any field not retrieved will have null or * default as its corresponding property value in the returned object. * @return a response containing the document object * @see <a href="https: */ @ServiceMethod(returns = ReturnType.S...
Is that right for directly changing?
public void afterLoadEventGetsFilteredForDomainTypeWorksForSubtypes() { SamplePersonEventListener personListener = new SamplePersonEventListener(); SampleIPersonEventListener contactListener = new SampleIPersonEventListener(); personListener.onApplicationEvent(new AfterLoadEvent<>(NullNode.getInstance(), Person.class, ...
assertThat(contactListener.invokedOnAfterLoad).isFalse();
public void afterLoadEventGetsFilteredForDomainTypeWorksForSubtypes() { SamplePersonEventListener personListener = new SamplePersonEventListener(); SampleIPersonEventListener contactListener = new SampleIPersonEventListener(); personListener.onApplicationEvent(new AfterLoadEvent<>(NullNode.getInstance(), Person.class, ...
class CosmosEventListenerUnitTests { @Test public void afterLoadEffectGetsHandledCorrectly() { SamplePersonEventListener listener = new SamplePersonEventListener(); listener.onApplicationEvent(new AfterLoadEvent<>(NullNode.getInstance(), Person.class, "container-1")); assertThat(listener.invokedOnAfterLoad).isTrue(); }...
class CosmosEventListenerUnitTests { @Test public void afterLoadEffectGetsHandledCorrectly() { SamplePersonEventListener listener = new SamplePersonEventListener(); listener.onApplicationEvent(new AfterLoadEvent<>(NullNode.getInstance(), Person.class, "container-1")); assertThat(listener.invokedOnAfterLoad).isTrue(); }...
if we fail over, should we fail the test ?
public void storeResponseRecordedOnException(Exception ex, StoreResponse storeResponse) { DiagnosticsClientContext clientContext = mockDiagnosticsClientContext(); TransportClientWrapper transportClientWrapper; if (ex != null) { transportClientWrapper = new TransportClientWrapper.Builder.ReplicaResponseBuilder .Sequenti...
return Mono.empty();
public void storeResponseRecordedOnException(Exception ex, StoreResponse storeResponse) { DiagnosticsClientContext clientContext = mockDiagnosticsClientContext(); TransportClientWrapper transportClientWrapper; if (ex != null) { transportClientWrapper = new TransportClientWrapper.Builder.ReplicaResponseBuilder .Sequenti...
class ConsistencyWriterTest { private final static DiagnosticsClientContext clientContext = mockDiagnosticsClientContext(); private AddressSelector addressSelector; private ISessionContainer sessionContainer; private TransportClient transportClient; private GatewayServiceConfigurationReader serviceConfigReader; private...
class ConsistencyWriterTest { private final static DiagnosticsClientContext clientContext = mockDiagnosticsClientContext(); private AddressSelector addressSelector; private ISessionContainer sessionContainer; private TransportClient transportClient; private GatewayServiceConfigurationReader serviceConfigReader; private...
We were not failing earlier, because it was `subscribe()` - test could have finished before we fail or succeed this method, however, we can. I will put it in next iteration.
public void storeResponseRecordedOnException(Exception ex, StoreResponse storeResponse) { DiagnosticsClientContext clientContext = mockDiagnosticsClientContext(); TransportClientWrapper transportClientWrapper; if (ex != null) { transportClientWrapper = new TransportClientWrapper.Builder.ReplicaResponseBuilder .Sequenti...
return Mono.empty();
public void storeResponseRecordedOnException(Exception ex, StoreResponse storeResponse) { DiagnosticsClientContext clientContext = mockDiagnosticsClientContext(); TransportClientWrapper transportClientWrapper; if (ex != null) { transportClientWrapper = new TransportClientWrapper.Builder.ReplicaResponseBuilder .Sequenti...
class ConsistencyWriterTest { private final static DiagnosticsClientContext clientContext = mockDiagnosticsClientContext(); private AddressSelector addressSelector; private ISessionContainer sessionContainer; private TransportClient transportClient; private GatewayServiceConfigurationReader serviceConfigReader; private...
class ConsistencyWriterTest { private final static DiagnosticsClientContext clientContext = mockDiagnosticsClientContext(); private AddressSelector addressSelector; private ISessionContainer sessionContainer; private TransportClient transportClient; private GatewayServiceConfigurationReader serviceConfigReader; private...
Should `maxMessages` be set to `1` here? If this is set to `null` will the service just return a single message?
public PeekedMessageItem peekMessage() { List<PeekedMessageItem> result = peekMessages(null, null, null).stream().collect(Collectors.toList()); return result.size() == 0 ? null : result.get(0); }
List<PeekedMessageItem> result = peekMessages(null, null, null).stream().collect(Collectors.toList());
public PeekedMessageItem peekMessage() { List<PeekedMessageItem> result = peekMessages(null, null, null).stream().collect(Collectors.toList()); return result.size() == 0 ? null : result.get(0); }
class QueueClient { private static final ClientLogger LOGGER = new ClientLogger(QueueClient.class); private final AzureQueueStorageImpl azureQueueStorage; private final String queueName; private final String accountName; private final QueueServiceVersion serviceVersion; private final QueueMessageEncoding messageEncodin...
class QueueClient { private static final ClientLogger LOGGER = new ClientLogger(QueueClient.class); private final AzureQueueStorageImpl azureQueueStorage; private final String queueName; private final String accountName; private final QueueServiceVersion serviceVersion; private final QueueMessageEncoding messageEncodin...
fixed.
public void storeResponseRecordedOnException(Exception ex, StoreResponse storeResponse) { DiagnosticsClientContext clientContext = mockDiagnosticsClientContext(); TransportClientWrapper transportClientWrapper; if (ex != null) { transportClientWrapper = new TransportClientWrapper.Builder.ReplicaResponseBuilder .Sequenti...
return Mono.empty();
public void storeResponseRecordedOnException(Exception ex, StoreResponse storeResponse) { DiagnosticsClientContext clientContext = mockDiagnosticsClientContext(); TransportClientWrapper transportClientWrapper; if (ex != null) { transportClientWrapper = new TransportClientWrapper.Builder.ReplicaResponseBuilder .Sequenti...
class ConsistencyWriterTest { private final static DiagnosticsClientContext clientContext = mockDiagnosticsClientContext(); private AddressSelector addressSelector; private ISessionContainer sessionContainer; private TransportClient transportClient; private GatewayServiceConfigurationReader serviceConfigReader; private...
class ConsistencyWriterTest { private final static DiagnosticsClientContext clientContext = mockDiagnosticsClientContext(); private AddressSelector addressSelector; private ISessionContainer sessionContainer; private TransportClient transportClient; private GatewayServiceConfigurationReader serviceConfigReader; private...
Remove trailing space in case the prefix already had one. ```suggestion headers.set(name, (prefix == null) ? credential : prefix.trim() + " " + credential); ```
void setCredential(HttpHeaders headers) { String credential = this.credential.getKey(); headers.set(name, (prefix == null) ? credential : prefix + " " + credential); }
headers.set(name, (prefix == null) ? credential : prefix + " " + credential);
void setCredential(HttpHeaders headers) { String credential = this.credential.getKey(); headers.set(name, (prefix == null) ? credential : prefix + " " + credential); }
class AzureKeyCredentialPolicy implements HttpPipelinePolicy { private static final ClientLogger LOGGER = new ClientLogger(AzureKeyCredentialPolicy.class); private final HttpHeaderName name; private final AzureKeyCredential credential; private final String prefix; /** * Creates a policy that uses the passed {@link Azur...
class AzureKeyCredentialPolicy implements HttpPipelinePolicy { private static final ClientLogger LOGGER = new ClientLogger(AzureKeyCredentialPolicy.class); private final HttpHeaderName name; private final AzureKeyCredential credential; private final String prefix; /** * Creates a policy that uses the passed {@link Azur...
In the existing async implementation it was set to null. I also just tested, and if we do not specify the maxMessages parameter, by default it grabs the first message.
public PeekedMessageItem peekMessage() { List<PeekedMessageItem> result = peekMessages(null, null, null).stream().collect(Collectors.toList()); return result.size() == 0 ? null : result.get(0); }
List<PeekedMessageItem> result = peekMessages(null, null, null).stream().collect(Collectors.toList());
public PeekedMessageItem peekMessage() { List<PeekedMessageItem> result = peekMessages(null, null, null).stream().collect(Collectors.toList()); return result.size() == 0 ? null : result.get(0); }
class QueueClient { private static final ClientLogger LOGGER = new ClientLogger(QueueClient.class); private final AzureQueueStorageImpl azureQueueStorage; private final String queueName; private final String accountName; private final QueueServiceVersion serviceVersion; private final QueueMessageEncoding messageEncodin...
class QueueClient { private static final ClientLogger LOGGER = new ClientLogger(QueueClient.class); private final AzureQueueStorageImpl azureQueueStorage; private final String queueName; private final String accountName; private final QueueServiceVersion serviceVersion; private final QueueMessageEncoding messageEncodin...
This should still be a single space.
private static Stream<Arguments> setCredentialSupplier() { AzureKeyCredential credential = new AzureKeyCredential("asecret"); return Stream.of( Arguments.of(new AzureKeyCredentialPolicy(HttpHeaderName.AUTHORIZATION, credential, null), "asecret"), Arguments.of(new AzureKeyCredentialPolicy(HttpHeaderName.AUTHORIZATION, c...
"SharedKeyCredential asecret")
private static Stream<Arguments> setCredentialSupplier() { AzureKeyCredential credential = new AzureKeyCredential("asecret"); return Stream.of( Arguments.of(new AzureKeyCredentialPolicy(HttpHeaderName.AUTHORIZATION, credential, null), "asecret"), Arguments.of(new AzureKeyCredentialPolicy(HttpHeaderName.AUTHORIZATION, c...
class AzureKeyCredentialPolicyTests { @ParameterizedTest @MethodSource("setCredentialSupplier") public void setCredential(AzureKeyCredentialPolicy policy, String expectedHeader) { HttpHeaders headers = new HttpHeaders(); policy.setCredential(headers); assertEquals(expectedHeader, headers.getValue(HttpHeaderName.AUTHORI...
class AzureKeyCredentialPolicyTests { @ParameterizedTest @MethodSource("setCredentialSupplier") public void setCredential(AzureKeyCredentialPolicy policy, String expectedHeader) { HttpHeaders headers = new HttpHeaders(); policy.setCredential(headers); assertEquals(expectedHeader, headers.getValue(HttpHeaderName.AUTHORI...
We have this block in every sample, but I think that we could probably do away with it, or maybe keep in one sample an explain what it is for.
public static void main(String[] args) { String azureOpenaiKey = "{azure-open-ai-key}"; String endpoint = "{azure-open-ai-endpoint}"; String deploymentOrModelId = "{azure-open-ai-deployment-model-id}"; OpenAIClient client = new OpenAIClientBuilder() .endpoint(endpoint) .credential(new AzureKeyCredential(azureOpenaiKey)...
+ "number of completion token is %d, and number of total tokens in request and response is %d.%n",
public static void main(String[] args) { String azureOpenaiKey = "{azure-open-ai-key}"; String endpoint = "{azure-open-ai-endpoint}"; String deploymentOrModelId = "{azure-open-ai-deployment-model-id}"; OpenAIClient client = new OpenAIClientBuilder() .endpoint(endpoint) .credential(new AzureKeyCredential(azureOpenaiKey)...
class ChatbotWithKeySample { /** * @param args Unused. Arguments to the program. */ }
class ChatbotWithKeySample { /** * @param args Unused. Arguments to the program. */ }
Totally agree, I added it to ChatbotWithKeySample.java for keeping and will scrub from the others.
public static void main(String[] args) { String azureOpenaiKey = "{azure-open-ai-key}"; String endpoint = "{azure-open-ai-endpoint}"; String deploymentOrModelId = "{azure-open-ai-deployment-model-id}"; OpenAIClient client = new OpenAIClientBuilder() .endpoint(endpoint) .credential(new AzureKeyCredential(azureOpenaiKey)...
+ "number of completion token is %d, and number of total tokens in request and response is %d.%n",
public static void main(String[] args) { String azureOpenaiKey = "{azure-open-ai-key}"; String endpoint = "{azure-open-ai-endpoint}"; String deploymentOrModelId = "{azure-open-ai-deployment-model-id}"; OpenAIClient client = new OpenAIClientBuilder() .endpoint(endpoint) .credential(new AzureKeyCredential(azureOpenaiKey)...
class ChatbotWithKeySample { /** * @param args Unused. Arguments to the program. */ }
class ChatbotWithKeySample { /** * @param args Unused. Arguments to the program. */ }
In which situations are we expecting the `pipeline` to already exist when this method is called?
private NonAzureOpenAIClientImpl buildInnerNonAzureOpenAIClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipelineNonAzureOpenAI(); NonAzureOpenAIClientImpl client = new NonAzureOpenAIClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); return client; }
HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipelineNonAzureOpenAI();
private NonAzureOpenAIClientImpl buildInnerNonAzureOpenAIClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipelineNonAzureOpenAI(); NonAzureOpenAIClientImpl client = new NonAzureOpenAIClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); return client; }
class OpenAIClientBuilder implements HttpTrait<OpenAIClientBuilder>, ConfigurationTrait<OpenAIClientBuilder>, TokenCredentialTrait<OpenAIClientBuilder>, AzureKeyCredentialTrait<OpenAIClientBuilder>, EndpointTrait<OpenAIClientBuilder> { @Generated private static final String SDK_NAME = "name"; @Generated private static ...
class OpenAIClientBuilder implements HttpTrait<OpenAIClientBuilder>, ConfigurationTrait<OpenAIClientBuilder>, TokenCredentialTrait<OpenAIClientBuilder>, AzureKeyCredentialTrait<OpenAIClientBuilder>, EndpointTrait<OpenAIClientBuilder> { @Generated private static final String SDK_NAME = "name"; @Generated private static ...
This could be me being overly paranoid or not understanding java concepts very well: I am a bit concerned about changes of internal state in this class that could come from different threads. Should we be annotating certain methods with `@Synchronized` ? I mean this, because I see a lot of null checks that could very e...
public OpenAIAsyncClient buildAsyncClient() { if (nonAzureOpenAIKeyCredential != null) { return new OpenAIAsyncClient(buildInnerNonAzureOpenAIClient()); } return new OpenAIAsyncClient(buildInnerClient()); }
}
public OpenAIAsyncClient buildAsyncClient() { if (nonAzureOpenAIKeyCredential != null) { return new OpenAIAsyncClient(buildInnerNonAzureOpenAIClient()); } return new OpenAIAsyncClient(buildInnerClient()); }
class OpenAIClientBuilder implements HttpTrait<OpenAIClientBuilder>, ConfigurationTrait<OpenAIClientBuilder>, TokenCredentialTrait<OpenAIClientBuilder>, AzureKeyCredentialTrait<OpenAIClientBuilder>, EndpointTrait<OpenAIClientBuilder> { @Generated private static final String SDK_NAME = "name"; @Generated private static ...
class OpenAIClientBuilder implements HttpTrait<OpenAIClientBuilder>, ConfigurationTrait<OpenAIClientBuilder>, TokenCredentialTrait<OpenAIClientBuilder>, AzureKeyCredentialTrait<OpenAIClientBuilder>, EndpointTrait<OpenAIClientBuilder> { @Generated private static final String SDK_NAME = "name"; @Generated private static ...
https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClientBuilder.java#L80 `pipeline` can be set in the builder method
private NonAzureOpenAIClientImpl buildInnerNonAzureOpenAIClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipelineNonAzureOpenAI(); NonAzureOpenAIClientImpl client = new NonAzureOpenAIClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); return client; }
HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipelineNonAzureOpenAI();
private NonAzureOpenAIClientImpl buildInnerNonAzureOpenAIClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipelineNonAzureOpenAI(); NonAzureOpenAIClientImpl client = new NonAzureOpenAIClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); return client; }
class OpenAIClientBuilder implements HttpTrait<OpenAIClientBuilder>, ConfigurationTrait<OpenAIClientBuilder>, TokenCredentialTrait<OpenAIClientBuilder>, AzureKeyCredentialTrait<OpenAIClientBuilder>, EndpointTrait<OpenAIClientBuilder> { @Generated private static final String SDK_NAME = "name"; @Generated private static ...
class OpenAIClientBuilder implements HttpTrait<OpenAIClientBuilder>, ConfigurationTrait<OpenAIClientBuilder>, TokenCredentialTrait<OpenAIClientBuilder>, AzureKeyCredentialTrait<OpenAIClientBuilder>, EndpointTrait<OpenAIClientBuilder> { @Generated private static final String SDK_NAME = "name"; @Generated private static ...
good point. I can add it to the method for double check, will wait for @srnagar
public OpenAIAsyncClient buildAsyncClient() { if (nonAzureOpenAIKeyCredential != null) { return new OpenAIAsyncClient(buildInnerNonAzureOpenAIClient()); } return new OpenAIAsyncClient(buildInnerClient()); }
}
public OpenAIAsyncClient buildAsyncClient() { if (nonAzureOpenAIKeyCredential != null) { return new OpenAIAsyncClient(buildInnerNonAzureOpenAIClient()); } return new OpenAIAsyncClient(buildInnerClient()); }
class OpenAIClientBuilder implements HttpTrait<OpenAIClientBuilder>, ConfigurationTrait<OpenAIClientBuilder>, TokenCredentialTrait<OpenAIClientBuilder>, AzureKeyCredentialTrait<OpenAIClientBuilder>, EndpointTrait<OpenAIClientBuilder> { @Generated private static final String SDK_NAME = "name"; @Generated private static ...
class OpenAIClientBuilder implements HttpTrait<OpenAIClientBuilder>, ConfigurationTrait<OpenAIClientBuilder>, TokenCredentialTrait<OpenAIClientBuilder>, AzureKeyCredentialTrait<OpenAIClientBuilder>, EndpointTrait<OpenAIClientBuilder> { @Generated private static final String SDK_NAME = "name"; @Generated private static ...
after talking to Srikanta Builder is not guaranteed to be thread-safe. so will leave it as it is.
public OpenAIAsyncClient buildAsyncClient() { if (nonAzureOpenAIKeyCredential != null) { return new OpenAIAsyncClient(buildInnerNonAzureOpenAIClient()); } return new OpenAIAsyncClient(buildInnerClient()); }
}
public OpenAIAsyncClient buildAsyncClient() { if (nonAzureOpenAIKeyCredential != null) { return new OpenAIAsyncClient(buildInnerNonAzureOpenAIClient()); } return new OpenAIAsyncClient(buildInnerClient()); }
class OpenAIClientBuilder implements HttpTrait<OpenAIClientBuilder>, ConfigurationTrait<OpenAIClientBuilder>, TokenCredentialTrait<OpenAIClientBuilder>, AzureKeyCredentialTrait<OpenAIClientBuilder>, EndpointTrait<OpenAIClientBuilder> { @Generated private static final String SDK_NAME = "name"; @Generated private static ...
class OpenAIClientBuilder implements HttpTrait<OpenAIClientBuilder>, ConfigurationTrait<OpenAIClientBuilder>, TokenCredentialTrait<OpenAIClientBuilder>, AzureKeyCredentialTrait<OpenAIClientBuilder>, EndpointTrait<OpenAIClientBuilder> { @Generated private static final String SDK_NAME = "name"; @Generated private static ...
This is practically the same, we can revert this.
public void canUpdateJobState() throws Exception { String jobId = getStringIdWithUserNamePrefix("-Job-CanUpdateState"); PoolInformation poolInfo = new PoolInformation(); poolInfo.withPoolId(poolId); batchClient.jobOperations().createJob(jobId, poolInfo); try { CloudJob job = batchClient.jobOperations().getJob(jobId); A...
Assert.assertTrue(JobState.DISABLING == job.state() || JobState.DISABLED == job.state());
public void canUpdateJobState() throws Exception { String jobId = getStringIdWithUserNamePrefix("-Job-CanUpdateState"); PoolInformation poolInfo = new PoolInformation(); poolInfo.withPoolId(poolId); batchClient.jobOperations().createJob(jobId, poolInfo); try { CloudJob job = batchClient.jobOperations().getJob(jobId); A...
class JobTests extends BatchIntegrationTestBase { private static CloudPool livePool; static String poolId; @BeforeClass public static void setup() throws Exception { poolId = getStringIdWithUserNamePrefix("-testpool"); if(isRecordMode()) { createClient(AuthMode.AAD); livePool = createIfNotExistIaaSPool(poolId); Assert....
class JobTests extends BatchIntegrationTestBase { private static CloudPool livePool; static String poolId; @BeforeClass public static void setup() throws Exception { poolId = getStringIdWithUserNamePrefix("-testpool"); if(isRecordMode()) { createClient(AuthMode.AAD); livePool = createIfNotExistIaaSPool(poolId); Assert....
Can we also assert if the value is true? ``` Assert.assertNotNull("Should have option on whether to use accelerated networking",pool.networkConfiguration().enableAcceleratedNetworking()); ```
public void canCRUDLowPriIaaSPool() throws Exception { String poolId = getStringIdWithUserNamePrefix("-canCRUDLowPri-testPool"); String POOL_VM_SIZE = "STANDARD_D1_V2"; int POOL_VM_COUNT = 2; int POOL_LOW_PRI_VM_COUNT = 2; long POOL_STEADY_TIMEOUT_IN_MILLISECONDS = 10 * 60 * 1000; TimeUnit.SECONDS.toMillis(30); if (!ba...
Assert.assertNotNull("Should have option on whether to use accelerated networking",pool.networkConfiguration().enableAcceleratedNetworking());
public void canCRUDLowPriIaaSPool() throws Exception { String poolId = getStringIdWithUserNamePrefix("-canCRUDLowPri-testPool"); String POOL_VM_SIZE = "STANDARD_D1_V2"; int POOL_VM_COUNT = 2; int POOL_LOW_PRI_VM_COUNT = 2; long POOL_STEADY_TIMEOUT_IN_MILLISECONDS = 10 * 60 * 1000; TimeUnit.SECONDS.toMillis(30); if (!ba...
class PoolTests extends BatchIntegrationTestBase { private static CloudPool livePool; private static String poolId; private static NetworkConfiguration networkConfiguration; @BeforeClass public static void setup() throws Exception { poolId = getStringIdWithUserNamePrefix("-testpool"); if(isRecordMode()) { createClient(...
class PoolTests extends BatchIntegrationTestBase { private static CloudPool livePool; private static String poolId; private static NetworkConfiguration networkConfiguration; @BeforeClass public static void setup() throws Exception { poolId = getStringIdWithUserNamePrefix("-testpool"); if(isRecordMode()) { createClient(...
Sure. Sorry I should use AssertTrue. I've modified.
public void canCRUDLowPriIaaSPool() throws Exception { String poolId = getStringIdWithUserNamePrefix("-canCRUDLowPri-testPool"); String POOL_VM_SIZE = "STANDARD_D1_V2"; int POOL_VM_COUNT = 2; int POOL_LOW_PRI_VM_COUNT = 2; long POOL_STEADY_TIMEOUT_IN_MILLISECONDS = 10 * 60 * 1000; TimeUnit.SECONDS.toMillis(30); if (!ba...
Assert.assertNotNull("Should have option on whether to use accelerated networking",pool.networkConfiguration().enableAcceleratedNetworking());
public void canCRUDLowPriIaaSPool() throws Exception { String poolId = getStringIdWithUserNamePrefix("-canCRUDLowPri-testPool"); String POOL_VM_SIZE = "STANDARD_D1_V2"; int POOL_VM_COUNT = 2; int POOL_LOW_PRI_VM_COUNT = 2; long POOL_STEADY_TIMEOUT_IN_MILLISECONDS = 10 * 60 * 1000; TimeUnit.SECONDS.toMillis(30); if (!ba...
class PoolTests extends BatchIntegrationTestBase { private static CloudPool livePool; private static String poolId; private static NetworkConfiguration networkConfiguration; @BeforeClass public static void setup() throws Exception { poolId = getStringIdWithUserNamePrefix("-testpool"); if(isRecordMode()) { createClient(...
class PoolTests extends BatchIntegrationTestBase { private static CloudPool livePool; private static String poolId; private static NetworkConfiguration networkConfiguration; @BeforeClass public static void setup() throws Exception { poolId = getStringIdWithUserNamePrefix("-testpool"); if(isRecordMode()) { createClient(...
The test may fail when I only assert DISTABLING state, because its actually state is DISABLED. I think it's because the state transition is quicker than we expect. So, I assert DISTABLING state or DISABLED state. The reason for the line 141 change is the same. Is the failing a normal phenomenon? (I originally think it ...
public void canUpdateJobState() throws Exception { String jobId = getStringIdWithUserNamePrefix("-Job-CanUpdateState"); PoolInformation poolInfo = new PoolInformation(); poolInfo.withPoolId(poolId); batchClient.jobOperations().createJob(jobId, poolInfo); try { CloudJob job = batchClient.jobOperations().getJob(jobId); A...
Assert.assertTrue(JobState.DISABLING == job.state() || JobState.DISABLED == job.state());
public void canUpdateJobState() throws Exception { String jobId = getStringIdWithUserNamePrefix("-Job-CanUpdateState"); PoolInformation poolInfo = new PoolInformation(); poolInfo.withPoolId(poolId); batchClient.jobOperations().createJob(jobId, poolInfo); try { CloudJob job = batchClient.jobOperations().getJob(jobId); A...
class JobTests extends BatchIntegrationTestBase { private static CloudPool livePool; static String poolId; @BeforeClass public static void setup() throws Exception { poolId = getStringIdWithUserNamePrefix("-testpool"); if(isRecordMode()) { createClient(AuthMode.AAD); livePool = createIfNotExistIaaSPool(poolId); Assert....
class JobTests extends BatchIntegrationTestBase { private static CloudPool livePool; static String poolId; @BeforeClass public static void setup() throws Exception { poolId = getStringIdWithUserNamePrefix("-testpool"); if(isRecordMode()) { createClient(AuthMode.AAD); livePool = createIfNotExistIaaSPool(poolId); Assert....
Ah never mind I misread that, LGTM.
public void canUpdateJobState() throws Exception { String jobId = getStringIdWithUserNamePrefix("-Job-CanUpdateState"); PoolInformation poolInfo = new PoolInformation(); poolInfo.withPoolId(poolId); batchClient.jobOperations().createJob(jobId, poolInfo); try { CloudJob job = batchClient.jobOperations().getJob(jobId); A...
Assert.assertTrue(JobState.DISABLING == job.state() || JobState.DISABLED == job.state());
public void canUpdateJobState() throws Exception { String jobId = getStringIdWithUserNamePrefix("-Job-CanUpdateState"); PoolInformation poolInfo = new PoolInformation(); poolInfo.withPoolId(poolId); batchClient.jobOperations().createJob(jobId, poolInfo); try { CloudJob job = batchClient.jobOperations().getJob(jobId); A...
class JobTests extends BatchIntegrationTestBase { private static CloudPool livePool; static String poolId; @BeforeClass public static void setup() throws Exception { poolId = getStringIdWithUserNamePrefix("-testpool"); if(isRecordMode()) { createClient(AuthMode.AAD); livePool = createIfNotExistIaaSPool(poolId); Assert....
class JobTests extends BatchIntegrationTestBase { private static CloudPool livePool; static String poolId; @BeforeClass public static void setup() throws Exception { poolId = getStringIdWithUserNamePrefix("-testpool"); if(isRecordMode()) { createClient(AuthMode.AAD); livePool = createIfNotExistIaaSPool(poolId); Assert....
Seems manual code here? You could put manual code part in a separate commit.
public KubernetesClusterNetworkProfileImpl withDockerBridgeCidr(String dockerBridgeCidr) { return this; }
return this;
public KubernetesClusterNetworkProfileImpl withDockerBridgeCidr(String dockerBridgeCidr) { return this; }
class KubernetesClusterNetworkProfileImpl implements KubernetesCluster.DefinitionStages.NetworkProfileDefinition< KubernetesCluster.DefinitionStages.WithCreate> { KubernetesClusterImpl parentKubernetesCluster; KubernetesClusterNetworkProfileImpl(KubernetesClusterImpl parent) { this.parentKubernetesCluster = parent; } @...
class KubernetesClusterNetworkProfileImpl implements KubernetesCluster.DefinitionStages.NetworkProfileDefinition< KubernetesCluster.DefinitionStages.WithCreate> { KubernetesClusterImpl parentKubernetesCluster; KubernetesClusterNetworkProfileImpl(KubernetesClusterImpl parent) { this.parentKubernetesCluster = parent; } @...
There should be a getter as well? If we don't have it, the better.
public KubernetesClusterNetworkProfileImpl withDockerBridgeCidr(String dockerBridgeCidr) { return this; }
return this;
public KubernetesClusterNetworkProfileImpl withDockerBridgeCidr(String dockerBridgeCidr) { return this; }
class KubernetesClusterNetworkProfileImpl implements KubernetesCluster.DefinitionStages.NetworkProfileDefinition< KubernetesCluster.DefinitionStages.WithCreate> { KubernetesClusterImpl parentKubernetesCluster; KubernetesClusterNetworkProfileImpl(KubernetesClusterImpl parent) { this.parentKubernetesCluster = parent; } @...
class KubernetesClusterNetworkProfileImpl implements KubernetesCluster.DefinitionStages.NetworkProfileDefinition< KubernetesCluster.DefinitionStages.WithCreate> { KubernetesClusterImpl parentKubernetesCluster; KubernetesClusterNetworkProfileImpl(KubernetesClusterImpl parent) { this.parentKubernetesCluster = parent; } @...
The class `KubernetesClusterNetworkProfileImpl` that implements an interface `KubernetesCluster.DefinitionStages.NetworkProfileDefinition` must implement all the methods declared in the interface, even if the method is marked as `deprecated`.
public KubernetesClusterNetworkProfileImpl withDockerBridgeCidr(String dockerBridgeCidr) { return this; }
return this;
public KubernetesClusterNetworkProfileImpl withDockerBridgeCidr(String dockerBridgeCidr) { return this; }
class KubernetesClusterNetworkProfileImpl implements KubernetesCluster.DefinitionStages.NetworkProfileDefinition< KubernetesCluster.DefinitionStages.WithCreate> { KubernetesClusterImpl parentKubernetesCluster; KubernetesClusterNetworkProfileImpl(KubernetesClusterImpl parent) { this.parentKubernetesCluster = parent; } @...
class KubernetesClusterNetworkProfileImpl implements KubernetesCluster.DefinitionStages.NetworkProfileDefinition< KubernetesCluster.DefinitionStages.WithCreate> { KubernetesClusterImpl parentKubernetesCluster; KubernetesClusterNetworkProfileImpl(KubernetesClusterImpl parent) { this.parentKubernetesCluster = parent; } @...
Strangely there's no corresponding getter method defined in the interface for this property. Guess we're good.
public KubernetesClusterNetworkProfileImpl withDockerBridgeCidr(String dockerBridgeCidr) { return this; }
return this;
public KubernetesClusterNetworkProfileImpl withDockerBridgeCidr(String dockerBridgeCidr) { return this; }
class KubernetesClusterNetworkProfileImpl implements KubernetesCluster.DefinitionStages.NetworkProfileDefinition< KubernetesCluster.DefinitionStages.WithCreate> { KubernetesClusterImpl parentKubernetesCluster; KubernetesClusterNetworkProfileImpl(KubernetesClusterImpl parent) { this.parentKubernetesCluster = parent; } @...
class KubernetesClusterNetworkProfileImpl implements KubernetesCluster.DefinitionStages.NetworkProfileDefinition< KubernetesCluster.DefinitionStages.WithCreate> { KubernetesClusterImpl parentKubernetesCluster; KubernetesClusterNetworkProfileImpl(KubernetesClusterImpl parent) { this.parentKubernetesCluster = parent; } @...
`printf` does formatting, don't need the `String.format`
public static void main(String[] args) { String connectionString = "endpoint={endpoint_value};id={id_value};secret={secret_value}"; final ConfigurationClient client = new ConfigurationClientBuilder() .connectionString(connectionString) .buildClient(); System.out.println("Beginning of synchronous sample..."); Configurat...
System.out.printf(String.format("[SetConfigurationSetting] Key: %s, Value: %s.%n", setting.getKey(), setting.getValue()));
public static void main(String[] args) { String connectionString = "endpoint={endpoint_value};id={id_value};secret={secret_value}"; final ConfigurationClient client = new ConfigurationClientBuilder() .connectionString(connectionString) .buildClient(); System.out.println("Beginning of synchronous sample..."); Configurat...
class CreateSnapshot { /** * Runs the sample demonstrates how to create, retrieve, archive, recover a configuration setting snapshot, and * list settings by snapshot name. * * @param args Unused. Arguments to the program. */ }
class CreateSnapshot { /** * Runs the sample demonstrates how to create, retrieve, archive, recover a configuration setting snapshot, and * list settings by snapshot name. * * @param args Unused. Arguments to the program. */ }
I got it. The getter is `ContainerServiceNetworkProfile networkProfile()`
public KubernetesClusterNetworkProfileImpl withDockerBridgeCidr(String dockerBridgeCidr) { return this; }
return this;
public KubernetesClusterNetworkProfileImpl withDockerBridgeCidr(String dockerBridgeCidr) { return this; }
class KubernetesClusterNetworkProfileImpl implements KubernetesCluster.DefinitionStages.NetworkProfileDefinition< KubernetesCluster.DefinitionStages.WithCreate> { KubernetesClusterImpl parentKubernetesCluster; KubernetesClusterNetworkProfileImpl(KubernetesClusterImpl parent) { this.parentKubernetesCluster = parent; } @...
class KubernetesClusterNetworkProfileImpl implements KubernetesCluster.DefinitionStages.NetworkProfileDefinition< KubernetesCluster.DefinitionStages.WithCreate> { KubernetesClusterImpl parentKubernetesCluster; KubernetesClusterNetworkProfileImpl(KubernetesClusterImpl parent) { this.parentKubernetesCluster = parent; } @...
Regarding `null` I think that the only reason this is nullable is because of streaming. Although, I am not entirely sure. I think that it could be useful once we have live testing to assert every possible enum value.
static void assertCompletions(int choicesPerPrompt, Completions actual) { assertCompletions(choicesPerPrompt, "stop", actual); }
assertCompletions(choicesPerPrompt, "stop", actual);
static void assertCompletions(int choicesPerPrompt, Completions actual) { assertCompletions(choicesPerPrompt, "stop", actual); }
class OpenAIClientTestBase extends TestProxyTestBase { OpenAIClientBuilder getOpenAIClientBuilder(HttpClient httpClient, OpenAIServiceVersion serviceVersion) { OpenAIClientBuilder builder = new OpenAIClientBuilder() .httpClient(httpClient) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEA...
class OpenAIClientTestBase extends TestProxyTestBase { OpenAIClientBuilder getOpenAIClientBuilder(HttpClient httpClient, OpenAIServiceVersion serviceVersion) { OpenAIClientBuilder builder = new OpenAIClientBuilder() .httpClient(httpClient) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEA...
fix comment
public void testEachAsyncThreadRefreshesToken() { AtomicLong refreshes = new AtomicLong(0); TokenCredential dummyCred = request -> { refreshes.incrementAndGet(); return incrementalRemoteGetTokenAsync(new AtomicInteger(1)); }; AtomicInteger atomicInteger = new AtomicInteger(0); AccessTokenCache cache = new AccessTokenCa...
public void testEachAsyncThreadRefreshesToken() { AtomicLong refreshes = new AtomicLong(0); TokenCredential dummyCred = request -> { refreshes.incrementAndGet(); return incrementalRemoteGetTokenAsync(new AtomicInteger(1)); }; AtomicInteger atomicInteger = new AtomicInteger(0); AccessTokenCache cache = new AccessTokenCa...
class TokenCacheTests { @BeforeEach void beforeEach() { StepVerifier.setDefaultTimeout(Duration.ofSeconds(30)); } @Test public void testOnlyOneThreadRefreshesToken() { AtomicLong refreshes = new AtomicLong(0); SimpleTokenCache cache = new SimpleTokenCache(() -> { refreshes.incrementAndGet(); return incrementalRemoteGet...
class TokenCacheTests { @BeforeEach void beforeEach() { StepVerifier.setDefaultTimeout(Duration.ofSeconds(30)); } @Test public void testOnlyOneThreadRefreshesToken() { AtomicLong refreshes = new AtomicLong(0); SimpleTokenCache cache = new SimpleTokenCache(() -> { refreshes.incrementAndGet(); return incrementalRemoteGet...
fix comment
public void testEachAsyncThreadRefreshesToken() { AtomicLong refreshes = new AtomicLong(0); TokenCredential dummyCred = request -> { refreshes.incrementAndGet(); return incrementalRemoteGetTokenAsync(new AtomicInteger(1)); }; AtomicInteger atomicInteger = new AtomicInteger(0); AccessTokenCache cache = new AccessTokenCa...
public void testEachAsyncThreadRefreshesToken() { AtomicLong refreshes = new AtomicLong(0); TokenCredential dummyCred = request -> { refreshes.incrementAndGet(); return incrementalRemoteGetTokenAsync(new AtomicInteger(1)); }; AtomicInteger atomicInteger = new AtomicInteger(0); AccessTokenCache cache = new AccessTokenCa...
class TokenCacheTests { @BeforeEach void beforeEach() { StepVerifier.setDefaultTimeout(Duration.ofSeconds(30)); } @Test public void testOnlyOneThreadRefreshesToken() { AtomicLong refreshes = new AtomicLong(0); SimpleTokenCache cache = new SimpleTokenCache(() -> { refreshes.incrementAndGet(); return incrementalRemoteGet...
class TokenCacheTests { @BeforeEach void beforeEach() { StepVerifier.setDefaultTimeout(Duration.ofSeconds(30)); } @Test public void testOnlyOneThreadRefreshesToken() { AtomicLong refreshes = new AtomicLong(0); SimpleTokenCache cache = new SimpleTokenCache(() -> { refreshes.incrementAndGet(); return incrementalRemoteGet...
nit: make this one line
public void azureKeyCredential() { AzureKeyCredential azureKeyCredential = new AzureKeyCredential("AZURE-SERVICE-KEY"); }
new AzureKeyCredential("AZURE-SERVICE-KEY");
public void azureKeyCredential() { AzureKeyCredential azureKeyCredential = new AzureKeyCredential("AZURE-SERVICE-KEY"); }
class AzureNamedKeyCredentialJavadocCodeSnippets { public void azureNamedKeyCredenialSasKey() { AzureNamedKeyCredential azureNamedKeyCredential = new AzureNamedKeyCredential("AZURE-SERVICE-SAS-KEY-NAME", "AZURE-SERVICE-SAS-KEY"); } public void azureSasCredential() { AzureSasCredential azureSasCredential = new AzureSasC...
class AzureNamedKeyCredentialJavadocCodeSnippets { public void azureNamedKeyCredenialSasKey() { AzureNamedKeyCredential azureNamedKeyCredential = new AzureNamedKeyCredential("AZURE-SERVICE-SAS-KEY-NAME", "AZURE-SERVICE-SAS-KEY"); } public void azureSasCredential() { AzureSasCredential azureSasCredential = new AzureSasC...
So canAccessFromTrustedServices is default true if public enabled. What's the default when public disabled? Is it false? Just a check on backend behavior.
public void testRegistryNetworkRules() { final String acrName = generateRandomResourceName("acr", 10); Registry registryWithDefaultNetworkRules = registryManager.containerRegistries() .define(acrName) .withRegion(Region.US_EAST) .withNewResourceGroup(rgName) .withPremiumSku() .create(); Assertions.assertEquals(SkuTier....
Assertions.assertTrue(registryWithDefaultNetworkRules.canAccessFromTrustedServices());
public void testRegistryNetworkRules() { final String acrName = generateRandomResourceName("acr", 10); Registry registryWithDefaultNetworkRules = registryManager.containerRegistries() .define(acrName) .withRegion(Region.US_EAST) .withNewResourceGroup(rgName) .withPremiumSku() .create(); Assertions.assertEquals(SkuTier....
class RegistryTaskTests extends RegistryTest { @Test @Disabled("Needs personal tokens to run") public void fileTaskTest() { final String acrName = generateRandomResourceName("acr", 10); String githubRepoUrl = "Replace with your github repository url, eg: https: String githubBranch = "Replace with your github repositoty...
class RegistryTaskTests extends RegistryTest { @Test @Disabled("Needs personal tokens to run") public void fileTaskTest() { final String acrName = generateRandomResourceName("acr", 10); String githubRepoUrl = "Replace with your github repository url, eg: https: String githubBranch = "Replace with your github repositoty...
I believe it's still true. I'll add a test case.
public void testRegistryNetworkRules() { final String acrName = generateRandomResourceName("acr", 10); Registry registryWithDefaultNetworkRules = registryManager.containerRegistries() .define(acrName) .withRegion(Region.US_EAST) .withNewResourceGroup(rgName) .withPremiumSku() .create(); Assertions.assertEquals(SkuTier....
Assertions.assertTrue(registryWithDefaultNetworkRules.canAccessFromTrustedServices());
public void testRegistryNetworkRules() { final String acrName = generateRandomResourceName("acr", 10); Registry registryWithDefaultNetworkRules = registryManager.containerRegistries() .define(acrName) .withRegion(Region.US_EAST) .withNewResourceGroup(rgName) .withPremiumSku() .create(); Assertions.assertEquals(SkuTier....
class RegistryTaskTests extends RegistryTest { @Test @Disabled("Needs personal tokens to run") public void fileTaskTest() { final String acrName = generateRandomResourceName("acr", 10); String githubRepoUrl = "Replace with your github repository url, eg: https: String githubBranch = "Replace with your github repositoty...
class RegistryTaskTests extends RegistryTest { @Test @Disabled("Needs personal tokens to run") public void fileTaskTest() { final String acrName = generateRandomResourceName("acr", 10); String githubRepoUrl = "Replace with your github repository url, eg: https: String githubBranch = "Replace with your github repositoty...
Verified. Public network access doesn't affect this setting.
public void testRegistryNetworkRules() { final String acrName = generateRandomResourceName("acr", 10); Registry registryWithDefaultNetworkRules = registryManager.containerRegistries() .define(acrName) .withRegion(Region.US_EAST) .withNewResourceGroup(rgName) .withPremiumSku() .create(); Assertions.assertEquals(SkuTier....
Assertions.assertTrue(registryWithDefaultNetworkRules.canAccessFromTrustedServices());
public void testRegistryNetworkRules() { final String acrName = generateRandomResourceName("acr", 10); Registry registryWithDefaultNetworkRules = registryManager.containerRegistries() .define(acrName) .withRegion(Region.US_EAST) .withNewResourceGroup(rgName) .withPremiumSku() .create(); Assertions.assertEquals(SkuTier....
class RegistryTaskTests extends RegistryTest { @Test @Disabled("Needs personal tokens to run") public void fileTaskTest() { final String acrName = generateRandomResourceName("acr", 10); String githubRepoUrl = "Replace with your github repository url, eg: https: String githubBranch = "Replace with your github repositoty...
class RegistryTaskTests extends RegistryTest { @Test @Disabled("Needs personal tokens to run") public void fileTaskTest() { final String acrName = generateRandomResourceName("acr", 10); String githubRepoUrl = "Replace with your github repository url, eg: https: String githubBranch = "Replace with your github repositoty...
Why doesn't this just return `listConfigurationSettingsForSnapshot(snapshotName, null)`?
public PagedFlux<ConfigurationSetting> listConfigurationSettingsForSnapshot(String snapshotName) { return new PagedFlux<>( () -> withContext( context -> serviceClient.getKeyValuesSinglePageAsync( null, null, null, null, null, snapshotName, addTracingNamespace(context)) .map(pagedResponse -> toConfigurationSettingWithPa...
return new PagedFlux<>(
public PagedFlux<ConfigurationSetting> listConfigurationSettingsForSnapshot(String snapshotName) { return listConfigurationSettingsForSnapshot(snapshotName, null); }
class ConfigurationAsyncClient { private static final ClientLogger LOGGER = new ClientLogger(ConfigurationAsyncClient.class); private final AzureAppConfigurationImpl serviceClient; private final SyncTokenPolicy syncTokenPolicy; final CreateSnapshotUtilClient createSnapshotUtilClient; /** * Creates a ConfigurationAsyncC...
class ConfigurationAsyncClient { private static final ClientLogger LOGGER = new ClientLogger(ConfigurationAsyncClient.class); private final AzureAppConfigurationImpl serviceClient; private final SyncTokenPolicy syncTokenPolicy; final CreateSnapshotUtilClient createSnapshotUtilClient; /** * Creates a ConfigurationAsyncC...
Remember to use the `Lock` pattern in async snippets so the subscribe actually does something if someone were to copy the example verbatim.
public void listConfigurationSettingsForSnapshot() { ConfigurationAsyncClient client = getAsyncClient(); String snapshotName = "{snapshotName}"; client.listConfigurationSettingsForSnapshot(snapshotName) .subscribe(setting -> System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue())); }
client.listConfigurationSettingsForSnapshot(snapshotName)
public void listConfigurationSettingsForSnapshot() { ConfigurationAsyncClient client = getAsyncClient(); String snapshotName = "{snapshotName}"; client.listConfigurationSettingsForSnapshot(snapshotName) .subscribe(setting -> System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue())); }
class ConfigurationAsyncClientJavaDocCodeSnippets { private static final String NO_LABEL = null; private String key1 = "key1"; private String key2 = "key2"; private String value1 = "val1"; private String value2 = "val2"; /** * Code snippets for {@link ConfigurationAsyncClient */ public void addConfigurationSettingsCode...
class ConfigurationAsyncClientJavaDocCodeSnippets { private static final String NO_LABEL = null; private String key1 = "key1"; private String key2 = "key2"; private String value1 = "val1"; private String value2 = "val2"; /** * Code snippets for {@link ConfigurationAsyncClient */ public void addConfigurationSettingsCode...
Good catch! Will update.
public PagedFlux<ConfigurationSetting> listConfigurationSettingsForSnapshot(String snapshotName) { return new PagedFlux<>( () -> withContext( context -> serviceClient.getKeyValuesSinglePageAsync( null, null, null, null, null, snapshotName, addTracingNamespace(context)) .map(pagedResponse -> toConfigurationSettingWithPa...
return new PagedFlux<>(
public PagedFlux<ConfigurationSetting> listConfigurationSettingsForSnapshot(String snapshotName) { return listConfigurationSettingsForSnapshot(snapshotName, null); }
class ConfigurationAsyncClient { private static final ClientLogger LOGGER = new ClientLogger(ConfigurationAsyncClient.class); private final AzureAppConfigurationImpl serviceClient; private final SyncTokenPolicy syncTokenPolicy; final CreateSnapshotUtilClient createSnapshotUtilClient; /** * Creates a ConfigurationAsyncC...
class ConfigurationAsyncClient { private static final ClientLogger LOGGER = new ClientLogger(ConfigurationAsyncClient.class); private final AzureAppConfigurationImpl serviceClient; private final SyncTokenPolicy syncTokenPolicy; final CreateSnapshotUtilClient createSnapshotUtilClient; /** * Creates a ConfigurationAsyncC...
Can you remind me of an example of that pattern?
public void listConfigurationSettingsForSnapshot() { ConfigurationAsyncClient client = getAsyncClient(); String snapshotName = "{snapshotName}"; client.listConfigurationSettingsForSnapshot(snapshotName) .subscribe(setting -> System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue())); }
client.listConfigurationSettingsForSnapshot(snapshotName)
public void listConfigurationSettingsForSnapshot() { ConfigurationAsyncClient client = getAsyncClient(); String snapshotName = "{snapshotName}"; client.listConfigurationSettingsForSnapshot(snapshotName) .subscribe(setting -> System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue())); }
class ConfigurationAsyncClientJavaDocCodeSnippets { private static final String NO_LABEL = null; private String key1 = "key1"; private String key2 = "key2"; private String value1 = "val1"; private String value2 = "val2"; /** * Code snippets for {@link ConfigurationAsyncClient */ public void addConfigurationSettingsCode...
class ConfigurationAsyncClientJavaDocCodeSnippets { private static final String NO_LABEL = null; private String key1 = "key1"; private String key2 = "key2"; private String value1 = "val1"; private String value2 = "val2"; /** * Code snippets for {@link ConfigurationAsyncClient */ public void addConfigurationSettingsCode...
https://github.com/Azure/azure-sdk-for-java/issues/35702
public void listConfigurationSettingsForSnapshot() { ConfigurationAsyncClient client = getAsyncClient(); String snapshotName = "{snapshotName}"; client.listConfigurationSettingsForSnapshot(snapshotName) .subscribe(setting -> System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue())); }
client.listConfigurationSettingsForSnapshot(snapshotName)
public void listConfigurationSettingsForSnapshot() { ConfigurationAsyncClient client = getAsyncClient(); String snapshotName = "{snapshotName}"; client.listConfigurationSettingsForSnapshot(snapshotName) .subscribe(setting -> System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue())); }
class ConfigurationAsyncClientJavaDocCodeSnippets { private static final String NO_LABEL = null; private String key1 = "key1"; private String key2 = "key2"; private String value1 = "val1"; private String value2 = "val2"; /** * Code snippets for {@link ConfigurationAsyncClient */ public void addConfigurationSettingsCode...
class ConfigurationAsyncClientJavaDocCodeSnippets { private static final String NO_LABEL = null; private String key1 = "key1"; private String key2 = "key2"; private String value1 = "val1"; private String value2 = "val2"; /** * Code snippets for {@link ConfigurationAsyncClient */ public void addConfigurationSettingsCode...
since we are differentiate pointOperation vs nonPointOperations, so I think we should rename the `endToEndOperationTimeout` -> `endToEndPointOperationTimeout`, and then add a new setter method for `endToEndPointOperationTimeout`
public CosmosEndToEndOperationLatencyPolicyConfigBuilder(Duration endToEndOperationTimeout) { this.endToEndOperationTimeout = endToEndOperationTimeout; endToEndFeedOperationTimeout = endToEndOperationTimeout; }
endToEndFeedOperationTimeout = endToEndOperationTimeout;
public CosmosEndToEndOperationLatencyPolicyConfigBuilder(Duration endToEndOperationTimeout) { this.endToEndOperationTimeout = endToEndOperationTimeout; }
class CosmosEndToEndOperationLatencyPolicyConfigBuilder { private boolean isEnabled = true; private final Duration endToEndOperationTimeout; private Duration endToEndFeedOperationTimeout; private AvailabilityStrategy availabilityStrategy; /** * Create a builder for {@link CosmosEndToEndOperationLatencyPolicyConfig} wit...
class CosmosEndToEndOperationLatencyPolicyConfigBuilder { private boolean isEnabled = true; private final Duration endToEndOperationTimeout; private AvailabilityStrategy availabilityStrategy; /** * Create a builder for {@link CosmosEndToEndOperationLatencyPolicyConfig} with end to end operation timeout * * @param endTo...
Call the list, do an assert on its count(). Whatever the behavior, API should work.
public void resourceHealthTest() { ComputeManager computeManager = ComputeManager .configure().withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) .authenticate(new DefaultAzureCredentialBuilder().build(), new AzureProfile(AzureEnvironment.AZURE)); ResourceHealthManager resourceHealthManager = Re...
public void resourceHealthTest() { ComputeManager computeManager = ComputeManager .configure().withLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) .authenticate(new DefaultAzureCredentialBuilder().build(), new AzureProfile(AzureEnvironment.AZURE)); ResourceHealthManager resourceHealthManager = Re...
class ResourceHealthTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST3; private static final String VM_NAME = "vm" + randomPadding(); private String resourceGroup = "rg" + randomPadding(); private static String randomPadding() { return String...
class ResourceHealthTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST3; private static final String VM_NAME = "vm" + randomPadding(); private String resourceGroup = "rg" + randomPadding(); private static String randomPadding() { return String...
Just FYI we can't always assume that `assets.json` is present right? We only want to pass along assets.json path if it actually exists. This code still assumes it'll always be there. (to be clear, that's not an explanation for the current failure, just for the future.)
private RecordedTestProxyData readDataFromFile() { try { File recordFile = new File(locateAssetJsonFilePath()); BufferedReader reader = Files.newBufferedReader(recordFile.toPath()); return RECORD_MAPPER.readValue(reader, RecordedTestProxyData.class); } catch (IOException ex) { throw new UncheckedIOException(ex); } }
BufferedReader reader = Files.newBufferedReader(recordFile.toPath());
private RecordedTestProxyData readDataFromFile() { try { BufferedReader reader = Files.newBufferedReader(Paths.get(interceptorManager.getRecordingFileLocation())); return RECORD_MAPPER.readValue(reader, RecordedTestProxyData.class); } catch (IOException ex) { throw new UncheckedIOException(ex); } }
class TestProxyTests extends TestProxyTestBase { public static final String TEST_DATA = "{\"test\":\"proxy\"}"; static TestProxyTestServer server; private static final ObjectMapper RECORD_MAPPER = new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT); private static final List<TestProxySanitizer> CUSTOM_SANITIZ...
class TestProxyTests extends TestProxyTestBase { public static final String TEST_DATA = "{\"test\":\"proxy\"}"; static TestProxyTestServer server; private static final ObjectMapper RECORD_MAPPER = new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT); private static final List<TestProxySanitizer> CUSTOM_SANITIZ...
Since this is a core-test package I think it should be fine to have this hard-coded here.
private RecordedTestProxyData readDataFromFile() { try { File recordFile = new File(locateAssetJsonFilePath()); BufferedReader reader = Files.newBufferedReader(recordFile.toPath()); return RECORD_MAPPER.readValue(reader, RecordedTestProxyData.class); } catch (IOException ex) { throw new UncheckedIOException(ex); } }
BufferedReader reader = Files.newBufferedReader(recordFile.toPath());
private RecordedTestProxyData readDataFromFile() { try { BufferedReader reader = Files.newBufferedReader(Paths.get(interceptorManager.getRecordingFileLocation())); return RECORD_MAPPER.readValue(reader, RecordedTestProxyData.class); } catch (IOException ex) { throw new UncheckedIOException(ex); } }
class TestProxyTests extends TestProxyTestBase { public static final String TEST_DATA = "{\"test\":\"proxy\"}"; static TestProxyTestServer server; private static final ObjectMapper RECORD_MAPPER = new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT); private static final List<TestProxySanitizer> CUSTOM_SANITIZ...
class TestProxyTests extends TestProxyTestBase { public static final String TEST_DATA = "{\"test\":\"proxy\"}"; static TestProxyTestServer server; private static final ObjectMapper RECORD_MAPPER = new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT); private static final List<TestProxySanitizer> CUSTOM_SANITIZ...
I would rather we change the return type here to include the recording path or make it a property on the playback client. Including a magic non-variable with the variables seems likely to cause a bug in the future.
public Queue<String> startPlayback(File recordFile, Path testClassPath) { HttpRequest request = null; String assetJsonPath = getAssetJsonFile(recordFile, testClassPath); try { request = new HttpRequest(HttpMethod.POST, String.format("%s/playback/start", proxyUrl)) .setBody(SERIALIZER.serialize(new RecordFilePayload(rec...
strings.addLast(xRecordingFileLocation);
public Queue<String> startPlayback(File recordFile, Path testClassPath) { HttpRequest request = null; String assetJsonPath = getAssetJsonFile(recordFile, testClassPath); try { request = new HttpRequest(HttpMethod.POST, String.format("%s/playback/start", proxyUrl)) .setBody(SERIALIZER.serialize(new RecordFilePayload(rec...
class path * @throws UncheckedIOException if an {@link IOException}
class path * @throws UncheckedIOException if an {@link IOException}
I thought about this. But adding it as a variable on the playback client we cannot retrieve it. We need it to be sent back from the playback client to the interceptor manager so that it can be exposed from there.
public Queue<String> startPlayback(File recordFile, Path testClassPath) { HttpRequest request = null; String assetJsonPath = getAssetJsonFile(recordFile, testClassPath); try { request = new HttpRequest(HttpMethod.POST, String.format("%s/playback/start", proxyUrl)) .setBody(SERIALIZER.serialize(new RecordFilePayload(rec...
strings.addLast(xRecordingFileLocation);
public Queue<String> startPlayback(File recordFile, Path testClassPath) { HttpRequest request = null; String assetJsonPath = getAssetJsonFile(recordFile, testClassPath); try { request = new HttpRequest(HttpMethod.POST, String.format("%s/playback/start", proxyUrl)) .setBody(SERIALIZER.serialize(new RecordFilePayload(rec...
class path * @throws UncheckedIOException if an {@link IOException}
class path * @throws UncheckedIOException if an {@link IOException}
I saw you have tests with finish reasons `stop` and `length`. How about cases for `content_filter` or `null`? I actually don't know how useful those would be, I only found them when searching for `finish_reason` [values](https://platform.openai.com/docs/guides/chat/response-format) (which I only could only find with a...
static void assertCompletions(int choicesPerPrompt, Completions actual) { assertCompletions(choicesPerPrompt, "stop", actual); }
assertCompletions(choicesPerPrompt, "stop", actual);
static void assertCompletions(int choicesPerPrompt, Completions actual) { assertCompletions(choicesPerPrompt, "stop", actual); }
class OpenAIClientTestBase extends TestProxyTestBase { OpenAIClientBuilder getOpenAIClientBuilder(HttpClient httpClient, OpenAIServiceVersion serviceVersion) { OpenAIClientBuilder builder = new OpenAIClientBuilder() .httpClient(httpClient) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEA...
class OpenAIClientTestBase extends TestProxyTestBase { OpenAIClientBuilder getOpenAIClientBuilder(HttpClient httpClient, OpenAIServiceVersion serviceVersion) { OpenAIClientBuilder builder = new OpenAIClientBuilder() .httpClient(httpClient) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEA...
I think that's fine.
public Queue<String> startPlayback(File recordFile, Path testClassPath) { HttpRequest request = null; String assetJsonPath = getAssetJsonFile(recordFile, testClassPath); try { request = new HttpRequest(HttpMethod.POST, String.format("%s/playback/start", proxyUrl)) .setBody(SERIALIZER.serialize(new RecordFilePayload(rec...
strings.addLast(xRecordingFileLocation);
public Queue<String> startPlayback(File recordFile, Path testClassPath) { HttpRequest request = null; String assetJsonPath = getAssetJsonFile(recordFile, testClassPath); try { request = new HttpRequest(HttpMethod.POST, String.format("%s/playback/start", proxyUrl)) .setBody(SERIALIZER.serialize(new RecordFilePayload(rec...
class path * @throws UncheckedIOException if an {@link IOException}
class path * @throws UncheckedIOException if an {@link IOException}
Looks good, but since we are using Passenger class here as the entity, we can actually use its `id` field as the id and partition key, like used in the above crudOperationOnItems example. Otherwise looks good, thanks!
public void readItem() { cosmosAsyncContainer.readItem(itemId, new PartitionKey(itemId), Passenger.class) .flatMap(response -> Mono.just(response.getItem())) .subscribe(passenger -> System.out.println(passenger), throwable -> { CosmosException cosmosException = (CosmosException) throwable; cosmosException.printStackTra...
cosmosAsyncContainer.readItem(itemId, new PartitionKey(itemId), Passenger.class)
public void readItem() { Passenger passenger = new Passenger("carla.davis@outlook.com", "Carla Davis", "SEA", "IND"); cosmosAsyncContainer.readItem(passenger.getId(), new PartitionKey(passenger.getId()), Passenger.class) .flatMap(response -> Mono.just(response.getItem())) .subscribe(passengerItem -> System.out.println(...
class ReadmeSamples { private final String serviceEndpoint = "<service-endpoint>"; private final String key = "<key>"; private final String itemId = UUID.randomUUID().toString(); private final DirectConnectionConfig directConnectionConfig = new DirectConnectionConfig(); private final GatewayConnectionConfig gatewayConn...
class ReadmeSamples { private final String serviceEndpoint = "<service-endpoint>"; private final String key = "<key>"; private final DirectConnectionConfig directConnectionConfig = new DirectConnectionConfig(); private final GatewayConnectionConfig gatewayConnectionConfig = new GatewayConnectionConfig(); private final ...
done, but I hid Passenger object initialization, is it ok?
public void readItem() { cosmosAsyncContainer.readItem(itemId, new PartitionKey(itemId), Passenger.class) .flatMap(response -> Mono.just(response.getItem())) .subscribe(passenger -> System.out.println(passenger), throwable -> { CosmosException cosmosException = (CosmosException) throwable; cosmosException.printStackTra...
cosmosAsyncContainer.readItem(itemId, new PartitionKey(itemId), Passenger.class)
public void readItem() { Passenger passenger = new Passenger("carla.davis@outlook.com", "Carla Davis", "SEA", "IND"); cosmosAsyncContainer.readItem(passenger.getId(), new PartitionKey(passenger.getId()), Passenger.class) .flatMap(response -> Mono.just(response.getItem())) .subscribe(passengerItem -> System.out.println(...
class ReadmeSamples { private final String serviceEndpoint = "<service-endpoint>"; private final String key = "<key>"; private final String itemId = UUID.randomUUID().toString(); private final DirectConnectionConfig directConnectionConfig = new DirectConnectionConfig(); private final GatewayConnectionConfig gatewayConn...
class ReadmeSamples { private final String serviceEndpoint = "<service-endpoint>"; private final String key = "<key>"; private final DirectConnectionConfig directConnectionConfig = new DirectConnectionConfig(); private final GatewayConnectionConfig gatewayConnectionConfig = new GatewayConnectionConfig(); private final ...
Can this ever be null? From the current code, it doesn't look like so.
public String getUserAgent() { String userAgent = null; if (this.feedResponseDiagnostics != null) { userAgent = this.feedResponseDiagnostics.getUserAgent(); } else if (this.clientSideRequestStatistics != null) { userAgent = this.clientSideRequestStatistics.getUserAgent(); } if (userAgent != null) { return userAgent; } ...
if (userAgent != null) {
public String getUserAgent() { if (this.feedResponseDiagnostics != null) { return this.feedResponseDiagnostics.getUserAgent(); } return this.clientSideRequestStatistics.getUserAgent(); }
class CosmosDiagnostics { private static final Logger LOGGER = LoggerFactory.getLogger(CosmosDiagnostics.class); static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); private static final String COSMOS_DIAGNOSTICS_KEY = "cosmosDiagnostics"; private ClientSideRequestStatistics clientSideRequestStatistics; privat...
class CosmosDiagnostics { private static final Logger LOGGER = LoggerFactory.getLogger(CosmosDiagnostics.class); static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); private static final String COSMOS_DIAGNOSTICS_KEY = "cosmosDiagnostics"; private ClientSideRequestStatistics clientSideRequestStatistics; privat...
FYI, this is never null.
public String getUserAgent() { if (this.diagnostics == null) { return ""; } CosmosDiagnostics diagnostics = this.diagnostics.peekFirst(); if (diagnostics == null) { return ""; } return diagnostics.getUserAgent(); }
if (this.diagnostics == null) {
public String getUserAgent() { return this.userAgent; }
class CosmosDiagnosticsContext { private final static ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagAccessor = ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); private final static ObjectMapper mapper = Utils.getSimpleObjectMapper(); private final S...
class CosmosDiagnosticsContext { private final static ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagAccessor = ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); private final static ObjectMapper mapper = Utils.getSimpleObjectMapper(); private final S...
for connection mode, why do we need to go through all diagnostics and iterator over them? Can't we use the connection mode set by customer on the client?
public String getConnectionMode() { if (this.diagnostics == null) { return ""; } for (CosmosDiagnostics d: this.diagnostics) { Collection<ClientSideRequestStatistics> clientStatsList = d.getClientSideRequestStatistics(); if (clientStatsList == null) { continue; } Iterator<ClientSideRequestStatistics> iterator = clientS...
if (this.diagnostics == null) {
public String getConnectionMode() { return this.connectionMode; }
class CosmosDiagnosticsContext { private final static ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagAccessor = ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); private final static ObjectMapper mapper = Utils.getSimpleObjectMapper(); private final S...
class CosmosDiagnosticsContext { private final static ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagAccessor = ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); private final static ObjectMapper mapper = Utils.getSimpleObjectMapper(); private final S...
You are right. Fixed.
public String getUserAgent() { String userAgent = null; if (this.feedResponseDiagnostics != null) { userAgent = this.feedResponseDiagnostics.getUserAgent(); } else if (this.clientSideRequestStatistics != null) { userAgent = this.clientSideRequestStatistics.getUserAgent(); } if (userAgent != null) { return userAgent; } ...
if (userAgent != null) {
public String getUserAgent() { if (this.feedResponseDiagnostics != null) { return this.feedResponseDiagnostics.getUserAgent(); } return this.clientSideRequestStatistics.getUserAgent(); }
class CosmosDiagnostics { private static final Logger LOGGER = LoggerFactory.getLogger(CosmosDiagnostics.class); static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); private static final String COSMOS_DIAGNOSTICS_KEY = "cosmosDiagnostics"; private ClientSideRequestStatistics clientSideRequestStatistics; privat...
class CosmosDiagnostics { private static final Logger LOGGER = LoggerFactory.getLogger(CosmosDiagnostics.class); static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); private static final String COSMOS_DIAGNOSTICS_KEY = "cosmosDiagnostics"; private ClientSideRequestStatistics clientSideRequestStatistics; privat...
True, fixed.
public String getUserAgent() { if (this.diagnostics == null) { return ""; } CosmosDiagnostics diagnostics = this.diagnostics.peekFirst(); if (diagnostics == null) { return ""; } return diagnostics.getUserAgent(); }
if (this.diagnostics == null) {
public String getUserAgent() { return this.userAgent; }
class CosmosDiagnosticsContext { private final static ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagAccessor = ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); private final static ObjectMapper mapper = Utils.getSimpleObjectMapper(); private final S...
class CosmosDiagnosticsContext { private final static ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagAccessor = ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); private final static ObjectMapper mapper = Utils.getSimpleObjectMapper(); private final S...
no easy way to access the client here.
public String getConnectionMode() { if (this.diagnostics == null) { return ""; } for (CosmosDiagnostics d: this.diagnostics) { Collection<ClientSideRequestStatistics> clientStatsList = d.getClientSideRequestStatistics(); if (clientStatsList == null) { continue; } Iterator<ClientSideRequestStatistics> iterator = clientS...
if (this.diagnostics == null) {
public String getConnectionMode() { return this.connectionMode; }
class CosmosDiagnosticsContext { private final static ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagAccessor = ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); private final static ObjectMapper mapper = Utils.getSimpleObjectMapper(); private final S...
class CosmosDiagnosticsContext { private final static ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagAccessor = ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); private final static ObjectMapper mapper = Utils.getSimpleObjectMapper(); private final S...
And i don't want to add new string field just for the rare case where this API is called.
public String getConnectionMode() { if (this.diagnostics == null) { return ""; } for (CosmosDiagnostics d: this.diagnostics) { Collection<ClientSideRequestStatistics> clientStatsList = d.getClientSideRequestStatistics(); if (clientStatsList == null) { continue; } Iterator<ClientSideRequestStatistics> iterator = clientS...
if (this.diagnostics == null) {
public String getConnectionMode() { return this.connectionMode; }
class CosmosDiagnosticsContext { private final static ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagAccessor = ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); private final static ObjectMapper mapper = Utils.getSimpleObjectMapper(); private final S...
class CosmosDiagnosticsContext { private final static ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagAccessor = ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); private final static ObjectMapper mapper = Utils.getSimpleObjectMapper(); private final S...
opt: may be ok if in future there are 10 or 11 parts? I.e. check if there are min 9 parts at least but more can be ok. Your call on this.
public static String[] getPartitionAndReplicaId(String serviceAddress) { if (serviceAddress == null) { return ArrayUtils.EMPTY_STRING_ARRAY; } String[] serviceAddressParts = serviceAddress.split("/"); if (serviceAddressParts.length != 9) { return null; } String[] result = new String[2]; result[0] = serviceAddressParts[...
if (serviceAddressParts.length != 9) {
public static String[] getPartitionAndReplicaId(String serviceAddress) { if (serviceAddress == null) { return ArrayUtils.EMPTY_STRING_ARRAY; } String[] serviceAddressParts = serviceAddress.split("/"); if (serviceAddressParts.length != 9) { return ArrayUtils.EMPTY_STRING_ARRAY; } String[] result = new String[2]; result[...
class StoreResultDiagnostics { private final long lsn; private final long quorumAckedLSN; private final long globalCommittedLSN; private final long numberOfReadRegions; private final long itemLSN; private final int currentReplicaSetSize; private final int currentWriteQuorum; private final boolean isValid; private boole...
class StoreResultDiagnostics { private final long lsn; private final long quorumAckedLSN; private final long globalCommittedLSN; private final long numberOfReadRegions; private final long itemLSN; private final int currentReplicaSetSize; private final int currentWriteQuorum; private final boolean isValid; private boole...
To be honest, passing the connection mode and user agent through DiagnosticsProvider seems to be easier and more efficient option, given its just 2 strings, as compared to lazily calculating this even if it is not getting called every time. Also, WMT might use this API a lot, so that would save overhead for them as wel...
public String getConnectionMode() { if (this.diagnostics == null) { return ""; } for (CosmosDiagnostics d: this.diagnostics) { Collection<ClientSideRequestStatistics> clientStatsList = d.getClientSideRequestStatistics(); if (clientStatsList == null) { continue; } Iterator<ClientSideRequestStatistics> iterator = clientS...
if (this.diagnostics == null) {
public String getConnectionMode() { return this.connectionMode; }
class CosmosDiagnosticsContext { private final static ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagAccessor = ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); private final static ObjectMapper mapper = Utils.getSimpleObjectMapper(); private final S...
class CosmosDiagnosticsContext { private final static ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagAccessor = ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); private final static ObjectMapper mapper = Utils.getSimpleObjectMapper(); private final S...
it may or may not be the CPU history logged in the diagnostics, but since it is close enough, so should be fine?
public String toJson() { String snapshot = this.cachedRequestDiagnostics; if (snapshot != null) { return snapshot; } synchronized (this.spanName) { snapshot = this.cachedRequestDiagnostics; if (snapshot != null) { return snapshot; } this.systemUsage = ClientSideRequestStatistics.fetchSystemInformation(); return this.ca...
this.systemUsage = ClientSideRequestStatistics.fetchSystemInformation();
public String toJson() { String snapshot = this.cachedRequestDiagnostics; if (snapshot != null) { return snapshot; } synchronized (this.spanName) { snapshot = this.cachedRequestDiagnostics; if (snapshot != null) { return snapshot; } this.systemUsage = ClientSideRequestStatistics.fetchSystemInformation(); return this.ca...
class CosmosDiagnosticsContext { private final static ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagAccessor = ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); private final static ObjectMapper mapper = Utils.getSimpleObjectMapper(); private final S...
class CosmosDiagnosticsContext { private final static ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagAccessor = ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); private final static ObjectMapper mapper = Utils.getSimpleObjectMapper(); private final S...
I rather leave it that way - because if the number of components changes parsing might also need to be adjusted - who knows where to extract partition and replica form when the Uri structure changes.
public static String[] getPartitionAndReplicaId(String serviceAddress) { if (serviceAddress == null) { return ArrayUtils.EMPTY_STRING_ARRAY; } String[] serviceAddressParts = serviceAddress.split("/"); if (serviceAddressParts.length != 9) { return null; } String[] result = new String[2]; result[0] = serviceAddressParts[...
if (serviceAddressParts.length != 9) {
public static String[] getPartitionAndReplicaId(String serviceAddress) { if (serviceAddress == null) { return ArrayUtils.EMPTY_STRING_ARRAY; } String[] serviceAddressParts = serviceAddress.split("/"); if (serviceAddressParts.length != 9) { return ArrayUtils.EMPTY_STRING_ARRAY; } String[] result = new String[2]; result[...
class StoreResultDiagnostics { private final long lsn; private final long quorumAckedLSN; private final long globalCommittedLSN; private final long numberOfReadRegions; private final long itemLSN; private final int currentReplicaSetSize; private final int currentWriteQuorum; private final boolean isValid; private boole...
class StoreResultDiagnostics { private final long lsn; private final long quorumAckedLSN; private final long globalCommittedLSN; private final long numberOfReadRegions; private final long itemLSN; private final int currentReplicaSetSize; private final int currentWriteQuorum; private final boolean isValid; private boole...
correct - not a functional requirement to be identical
public String toJson() { String snapshot = this.cachedRequestDiagnostics; if (snapshot != null) { return snapshot; } synchronized (this.spanName) { snapshot = this.cachedRequestDiagnostics; if (snapshot != null) { return snapshot; } this.systemUsage = ClientSideRequestStatistics.fetchSystemInformation(); return this.ca...
this.systemUsage = ClientSideRequestStatistics.fetchSystemInformation();
public String toJson() { String snapshot = this.cachedRequestDiagnostics; if (snapshot != null) { return snapshot; } synchronized (this.spanName) { snapshot = this.cachedRequestDiagnostics; if (snapshot != null) { return snapshot; } this.systemUsage = ClientSideRequestStatistics.fetchSystemInformation(); return this.ca...
class CosmosDiagnosticsContext { private final static ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagAccessor = ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); private final static ObjectMapper mapper = Utils.getSimpleObjectMapper(); private final S...
class CosmosDiagnosticsContext { private final static ImplementationBridgeHelpers.CosmosDiagnosticsHelper.CosmosDiagnosticsAccessor diagAccessor = ImplementationBridgeHelpers.CosmosDiagnosticsHelper.getCosmosDiagnosticsAccessor(); private final static ObjectMapper mapper = Utils.getSimpleObjectMapper(); private final S...
Yeah, this is to keep Reactor from sending too many values too quickly.
public void onSubscribe(Subscription s) { if (Operators.validate(subscription, s)) { subscription = s; s.request(1); } }
s.request(1);
public void onSubscribe(Subscription s) { if (Operators.validate(subscription, s)) { subscription = s; s.request(1); } }
class VertxRequestWriteSubscriber implements Subscriber<ByteBuffer> { private static final ClientLogger LOGGER = new ClientLogger(VertxRequestWriteSubscriber.class); private final HttpClientRequest request; private final MonoSink<HttpResponse> emitter; private final ProgressReporter progressReporter; private volatile S...
class VertxRequestWriteSubscriber implements Subscriber<ByteBuffer> { private static final ClientLogger LOGGER = new ClientLogger(VertxRequestWriteSubscriber.class); private final HttpClientRequest request; private final MonoSink<HttpResponse> emitter; private final ProgressReporter progressReporter; private volatile S...
do we need to update recordings for this change?
static AnalyzeHealthcareEntitiesResult getRecognizeHealthcareEntitiesResult1(String documentId) { TextDocumentStatistics textDocumentStatistics1 = new TextDocumentStatistics(105, 1); final HealthcareEntity healthcareEntity1 = new HealthcareEntity(); HealthcareEntityPropertiesHelper.setText(healthcareEntity1, "54-year-o...
HealthcareEntityPropertiesHelper.setText(healthcareEntity3, "progressive angina");
static AnalyzeHealthcareEntitiesResult getRecognizeHealthcareEntitiesResult1(String documentId) { TextDocumentStatistics textDocumentStatistics1 = new TextDocumentStatistics(105, 1); final HealthcareEntity healthcareEntity1 = new HealthcareEntity(); HealthcareEntityPropertiesHelper.setText(healthcareEntity1, "54-year-o...
class TestUtils { private static final String DEFAULT_MODEL_VERSION = "2019-10-01"; static final OffsetDateTime TIME_NOW = OffsetDateTime.now(); static final String INVALID_URL = "htttttttps: static final String VALID_HTTPS_LOCALHOST = "https: static final String FAKE_API_KEY = "fakeKeyPlaceholder"; static final String...
class TestUtils { private static final String DEFAULT_MODEL_VERSION = "2019-10-01"; static final OffsetDateTime TIME_NOW = OffsetDateTime.now(); static final String INVALID_URL = "htttttttps: static final String VALID_HTTPS_LOCALHOST = "https: static final String FAKE_API_KEY = "fakeKeyPlaceholder"; static final String...
we can not have this API call instead of passing ignored function values.
private HttpClient buildAsyncAssertingClient(HttpClient httpClient) { return new AssertingHttpClientBuilder(httpClient) .skipRequest((ignored1, ignored2) -> true) .assertAsync() .build(); }
.skipRequest((ignored1, ignored2) -> true)
private HttpClient buildAsyncAssertingClient(HttpClient httpClient) { return new AssertingHttpClientBuilder(httpClient) .assertAsync() .build(); }
class CertificateAsyncClientTest extends CertificateClientTestBase { private CertificateAsyncClient certificateAsyncClient; @Override protected void beforeTest() { beforeTestSetup(); } private void createCertificateAsyncClient(HttpClient httpClient, CertificateServiceVersion serviceVersion) { createCertificateAsyncClie...
class CertificateAsyncClientTest extends CertificateClientTestBase { private CertificateAsyncClient certificateAsyncClient; @Override protected void beforeTest() { beforeTestSetup(); } private void createCertificateAsyncClient(HttpClient httpClient, CertificateServiceVersion serviceVersion) { createCertificateAsyncClie...
revert?
public void cancelCertificateOperation(HttpClient httpClient, CertificateServiceVersion serviceVersion) { createCertificateAsyncClient(httpClient, serviceVersion); cancelCertificateOperationRunner((certName) -> { PollerFlux<CertificateOperation, KeyVaultCertificateWithPolicy> certPoller = certificateAsyncClient.beginCr...
"cancelled".equalsIgnoreCase(asyncPollResponse.getStatus().toString()))
public void cancelCertificateOperation(HttpClient httpClient, CertificateServiceVersion serviceVersion) { createCertificateAsyncClient(httpClient, serviceVersion); cancelCertificateOperationRunner((certName) -> { PollerFlux<CertificateOperation, KeyVaultCertificateWithPolicy> certPoller = certificateAsyncClient.beginCr...
class CertificateAsyncClientTest extends CertificateClientTestBase { private CertificateAsyncClient certificateAsyncClient; @Override protected void beforeTest() { beforeTestSetup(); } private void createCertificateAsyncClient(HttpClient httpClient, CertificateServiceVersion serviceVersion) { createCertificateAsyncClie...
class CertificateAsyncClientTest extends CertificateClientTestBase { private CertificateAsyncClient certificateAsyncClient; @Override protected void beforeTest() { beforeTestSetup(); } private void createCertificateAsyncClient(HttpClient httpClient, CertificateServiceVersion serviceVersion) { createCertificateAsyncClie...
No, the service returns "cancelled" instead of "user_cancelled" and has for quite some time. I don't know why the tests never caught this, but I went back to some old recordings and found "cancelled" was the value used. I'll check some very old recordings just in case.
public void cancelCertificateOperation(HttpClient httpClient, CertificateServiceVersion serviceVersion) { createCertificateAsyncClient(httpClient, serviceVersion); cancelCertificateOperationRunner((certName) -> { PollerFlux<CertificateOperation, KeyVaultCertificateWithPolicy> certPoller = certificateAsyncClient.beginCr...
"cancelled".equalsIgnoreCase(asyncPollResponse.getStatus().toString()))
public void cancelCertificateOperation(HttpClient httpClient, CertificateServiceVersion serviceVersion) { createCertificateAsyncClient(httpClient, serviceVersion); cancelCertificateOperationRunner((certName) -> { PollerFlux<CertificateOperation, KeyVaultCertificateWithPolicy> certPoller = certificateAsyncClient.beginCr...
class CertificateAsyncClientTest extends CertificateClientTestBase { private CertificateAsyncClient certificateAsyncClient; @Override protected void beforeTest() { beforeTestSetup(); } private void createCertificateAsyncClient(HttpClient httpClient, CertificateServiceVersion serviceVersion) { createCertificateAsyncClie...
class CertificateAsyncClientTest extends CertificateClientTestBase { private CertificateAsyncClient certificateAsyncClient; @Override protected void beforeTest() { beforeTestSetup(); } private void createCertificateAsyncClient(HttpClient httpClient, CertificateServiceVersion serviceVersion) { createCertificateAsyncClie...
Just did.
static AnalyzeHealthcareEntitiesResult getRecognizeHealthcareEntitiesResult1(String documentId) { TextDocumentStatistics textDocumentStatistics1 = new TextDocumentStatistics(105, 1); final HealthcareEntity healthcareEntity1 = new HealthcareEntity(); HealthcareEntityPropertiesHelper.setText(healthcareEntity1, "54-year-o...
HealthcareEntityPropertiesHelper.setText(healthcareEntity3, "progressive angina");
static AnalyzeHealthcareEntitiesResult getRecognizeHealthcareEntitiesResult1(String documentId) { TextDocumentStatistics textDocumentStatistics1 = new TextDocumentStatistics(105, 1); final HealthcareEntity healthcareEntity1 = new HealthcareEntity(); HealthcareEntityPropertiesHelper.setText(healthcareEntity1, "54-year-o...
class TestUtils { private static final String DEFAULT_MODEL_VERSION = "2019-10-01"; static final OffsetDateTime TIME_NOW = OffsetDateTime.now(); static final String INVALID_URL = "htttttttps: static final String VALID_HTTPS_LOCALHOST = "https: static final String FAKE_API_KEY = "fakeKeyPlaceholder"; static final String...
class TestUtils { private static final String DEFAULT_MODEL_VERSION = "2019-10-01"; static final OffsetDateTime TIME_NOW = OffsetDateTime.now(); static final String INVALID_URL = "htttttttps: static final String VALID_HTTPS_LOCALHOST = "https: static final String FAKE_API_KEY = "fakeKeyPlaceholder"; static final String...
Why the version change?
public AzureDatabricksManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder .append("azsdk-java") .a...
.append("1.0.0-beta.4");
public AzureDatabricksManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder .append("azsdk-java") .a...
class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List<HttpPipelinePolicy> policies = new ArrayList<>(); private final List<String> scopes = new ArrayList<>(); private RetryPolicy retr...
class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List<HttpPipelinePolicy> policies = new ArrayList<>(); private final List<String> scopes = new ArrayList<>(); private RetryPolicy retr...
reverted
public AzureDatabricksManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder .append("azsdk-java") .a...
.append("1.0.0-beta.4");
public AzureDatabricksManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder .append("azsdk-java") .a...
class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List<HttpPipelinePolicy> policies = new ArrayList<>(); private final List<String> scopes = new ArrayList<>(); private RetryPolicy retr...
class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List<HttpPipelinePolicy> policies = new ArrayList<>(); private final List<String> scopes = new ArrayList<>(); private RetryPolicy retr...
nit, maybe "A mixture of legacy WAF configuration and WAF policy is not allowed."
private void ensureNoMixedWaf() { String errorMessage = "Can't have a mixture of legacy WAF configuration and WAF policy. " + "If you are using legacy WAF configuration, you are strongly encouraged to upgrade to WAF Policy " + "for easier management, better scale, and a richer feature set at no additional cost. " + "Se...
String errorMessage = "Can't have a mixture of legacy WAF configuration and WAF policy. "
private void ensureNoMixedWaf() { String errorMessage = "A mixture of legacy WAF configuration and WAF policy is not allowed. " + "If you are using legacy WAF configuration, you are strongly encouraged to upgrade to WAF Policy " + "for easier management, better scale, and a richer feature set at no additional cost. " +...
class ApplicationGatewayImpl extends GroupableParentResourceWithTagsImpl< ApplicationGateway, ApplicationGatewayInner, ApplicationGatewayImpl, NetworkManager> implements ApplicationGateway, ApplicationGateway.Definition, ApplicationGateway.Update { private Map<String, ApplicationGatewayIpConfiguration> ipConfigs; priva...
class ApplicationGatewayImpl extends GroupableParentResourceWithTagsImpl< ApplicationGateway, ApplicationGatewayInner, ApplicationGatewayImpl, NetworkManager> implements ApplicationGateway, ApplicationGateway.Definition, ApplicationGateway.Update { private Map<String, ApplicationGatewayIpConfiguration> ipConfigs; priva...
nit, unmodifiedList?
public List<String> getAssociatedApplicationGatewayIds() { if (CoreUtils.isNullOrEmpty(this.innerModel().applicationGateways())) { return Collections.emptyList(); } return this.innerModel().applicationGateways() .stream() .map(ApplicationGatewayInner::id) .collect(Collectors.toList()); }
.collect(Collectors.toList());
public List<String> getAssociatedApplicationGatewayIds() { if (CoreUtils.isNullOrEmpty(this.innerModel().applicationGateways())) { return Collections.emptyList(); } return Collections.unmodifiableList(this.innerModel().applicationGateways() .stream() .map(ApplicationGatewayInner::id) .collect(Collectors.toList())); }
class WebApplicationFirewallPolicyImpl extends GroupableResourceImpl< WebApplicationFirewallPolicy, WebApplicationFirewallPolicyInner, WebApplicationFirewallPolicyImpl, NetworkManager> implements WebApplicationFirewallPolicy, WebApplicationFirewallPolicy.Definition, WebApplicationFirewallPolicy.Update, WebApplicationFi...
class WebApplicationFirewallPolicyImpl extends GroupableResourceImpl< WebApplicationFirewallPolicy, WebApplicationFirewallPolicyInner, WebApplicationFirewallPolicyImpl, NetworkManager> implements WebApplicationFirewallPolicy, WebApplicationFirewallPolicy.Definition, WebApplicationFirewallPolicy.Update, WebApplicationFi...
changed
public List<String> getAssociatedApplicationGatewayIds() { if (CoreUtils.isNullOrEmpty(this.innerModel().applicationGateways())) { return Collections.emptyList(); } return this.innerModel().applicationGateways() .stream() .map(ApplicationGatewayInner::id) .collect(Collectors.toList()); }
.collect(Collectors.toList());
public List<String> getAssociatedApplicationGatewayIds() { if (CoreUtils.isNullOrEmpty(this.innerModel().applicationGateways())) { return Collections.emptyList(); } return Collections.unmodifiableList(this.innerModel().applicationGateways() .stream() .map(ApplicationGatewayInner::id) .collect(Collectors.toList())); }
class WebApplicationFirewallPolicyImpl extends GroupableResourceImpl< WebApplicationFirewallPolicy, WebApplicationFirewallPolicyInner, WebApplicationFirewallPolicyImpl, NetworkManager> implements WebApplicationFirewallPolicy, WebApplicationFirewallPolicy.Definition, WebApplicationFirewallPolicy.Update, WebApplicationFi...
class WebApplicationFirewallPolicyImpl extends GroupableResourceImpl< WebApplicationFirewallPolicy, WebApplicationFirewallPolicyInner, WebApplicationFirewallPolicyImpl, NetworkManager> implements WebApplicationFirewallPolicy, WebApplicationFirewallPolicy.Definition, WebApplicationFirewallPolicy.Update, WebApplicationFi...
what happens if we don't set these empty lists (and object with only empty lists within)? we don't want to show user these empty list, which appear to be meaningless. if empty list is really needed, use Collections.emptyList
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String descriptionName = "iotHub" + randomPadding(); iotHubDescription = iotHubManager.iotHubResources() .define(descriptionName) .withRegion(REGION) .withExistingResourceGroup(resourceGroupName) .withSku(new IotHubSkuInfo().withNam...
.withRoutes(Arrays.asList())
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String iothubName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount(2));...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
same here
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String descriptionName = "iotHub" + randomPadding(); iotHubDescription = iotHubManager.iotHubResources() .define(descriptionName) .withRegion(REGION) .withExistingResourceGroup(resourceGroupName) .withSku(new IotHubSkuInfo().withNam...
.withAllowedFqdnList(Arrays.asList())
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String iothubName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount(2));...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
please just use normal Java code for Map, I assume you know what to write? ``` Map<> someMap = new HashMap<>(); someMap.put(.., ..);
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String descriptionName = "iotHub" + randomPadding(); iotHubDescription = iotHubManager.iotHubResources() .define(descriptionName) .withRegion(REGION) .withExistingResourceGroup(resourceGroupName) .withSku(new IotHubSkuInfo().withNam...
})
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String iothubName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount(2));...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
In this case of only a single entry, use `Collections.singletonMap`. This is basic Java. Ideally we'd like to use `Map.of` but that is only available since 11.
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String descriptionName = "iotHub" + randomPadding(); iotHubDescription = iotHubManager.iotHubResources() .define(descriptionName) .withRegion(REGION) .withExistingResourceGroup(resourceGroupName) .withSku(new IotHubSkuInfo().withNam...
})
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String iothubName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount(2));...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
Fixed in the new version.
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String descriptionName = "iotHub" + randomPadding(); iotHubDescription = iotHubManager.iotHubResources() .define(descriptionName) .withRegion(REGION) .withExistingResourceGroup(resourceGroupName) .withSku(new IotHubSkuInfo().withNam...
})
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String iothubName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount(2));...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
sorry, one thing more, please move this embedmeStart tag to the line before those `Map<> = ` code. These Maps are also valuable configures that user can refer.
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String descriptionName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount...
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String iothubName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount(2));...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
nit, why it is call `descriptionName`, instead of e.g. `hubName`?
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String descriptionName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount...
String descriptionName = "iotHub" + randomPadding();
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String iothubName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount(2));...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
seems `// @embedmeStart`, not `// embedmeStart`?
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String descriptionName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount...
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String iothubName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount(2));...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
`// @embedmeEnd`
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String descriptionName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount...
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String iothubName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount(2));...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
Fixed in the new version.
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String descriptionName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount...
String descriptionName = "iotHub" + randomPadding();
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String iothubName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount(2));...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
Ah, yes, good catch. @v-hongli1 Please fix.
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String descriptionName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount...
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String iothubName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount(2));...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
Fixed in the new version.
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String descriptionName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount...
public void testIotHubDescription() { IotHubDescription iotHubDescription = null; try { String iothubName = "iotHub" + randomPadding(); Map<String, EventHubProperties> eventHubEndpointsMap = new HashMap<>(); eventHubEndpointsMap.put("events", new EventHubProperties() .withRetentionTimeInDays(1L).withPartitionCount(2));...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
class IotHubManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private IotHubManager iotHubManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
These are static methods that get used by ParameterizedTests, so they can't take method arguments.
static String getIsolatedSigningKeyBase64() { return TEST_MODE == TestMode.PLAYBACK ? readResource("isolatedSigningKey") : Configuration.getGlobalConfiguration().get("isolatedSigningKey"); }
return TEST_MODE == TestMode.PLAYBACK
static String getIsolatedSigningKeyBase64() { return TEST_MODE == TestMode.PLAYBACK ? readResource("isolatedSigningKey") : Configuration.getGlobalConfiguration().get("isolatedSigningKey"); }
class AttestationClientTestBase extends TestProxyTestBase { protected static final SerializerAdapter ADAPTER = JacksonAdapter.createDefaultSerializerAdapter(); protected static final String DISPLAY_NAME_WITH_ARGUMENTS = "{displayName} with [{arguments}]"; protected static final ClientLogger LOGGER = new ClientLogger(At...
class AttestationClientTestBase extends TestProxyTestBase { protected static final SerializerAdapter ADAPTER = JacksonAdapter.createDefaultSerializerAdapter(); protected static final String DISPLAY_NAME_WITH_ARGUMENTS = "{displayName} with [{arguments}]"; protected static final ClientLogger LOGGER = new ClientLogger(At...
Add a comment here, stating that user MUST change the password if they use the code.
public void testCreateServer() { Server server = null; String randomPadding = randomPadding(); try { String serverName = "mysql" + randomPadding; String adminName = "sqlsa" + randomPadding; server = mysqlManager.servers() .define(serverName) .withRegion(REGION) .withExistingResourceGroup(resourceGroupName) .withPropert...
.withAdministratorLoginPassword("!QA2ws
public void testCreateServer() { Server server = null; String randomPadding = randomPadding(); try { String serverName = "mysql" + randomPadding; String adminName = "sqlAdmin" + randomPadding; String adminPwd = "sqlAdmin" + UUID.randomUUID().toString().replace("-", StringUtil.EMPTY_STRING).substring(0, 8); server = mys...
class MySqlManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.EUROPE_WEST; private String resourceGroupName = "rg" + randomPadding(); private MySqlManager mysqlManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
class MySqlManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.EUROPE_WEST; private String resourceGroupName = "rg" + randomPadding(); private MySqlManager mysqlManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
The password setting has been changed to randomly generated.
public void testCreateServer() { Server server = null; String randomPadding = randomPadding(); try { String serverName = "mysql" + randomPadding; String adminName = "sqlsa" + randomPadding; server = mysqlManager.servers() .define(serverName) .withRegion(REGION) .withExistingResourceGroup(resourceGroupName) .withPropert...
.withAdministratorLoginPassword("!QA2ws
public void testCreateServer() { Server server = null; String randomPadding = randomPadding(); try { String serverName = "mysql" + randomPadding; String adminName = "sqlAdmin" + randomPadding; String adminPwd = "sqlAdmin" + UUID.randomUUID().toString().replace("-", StringUtil.EMPTY_STRING).substring(0, 8); server = mys...
class MySqlManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.EUROPE_WEST; private String resourceGroupName = "rg" + randomPadding(); private MySqlManager mysqlManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
class MySqlManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.EUROPE_WEST; private String resourceGroupName = "rg" + randomPadding(); private MySqlManager mysqlManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
OK. Make sure your local run still pass.
public void testCreateServer() { Server server = null; String randomPadding = randomPadding(); try { String serverName = "mysql" + randomPadding; String adminName = "sqlsa" + randomPadding; server = mysqlManager.servers() .define(serverName) .withRegion(REGION) .withExistingResourceGroup(resourceGroupName) .withPropert...
.withAdministratorLoginPassword("!QA2ws
public void testCreateServer() { Server server = null; String randomPadding = randomPadding(); try { String serverName = "mysql" + randomPadding; String adminName = "sqlAdmin" + randomPadding; String adminPwd = "sqlAdmin" + UUID.randomUUID().toString().replace("-", StringUtil.EMPTY_STRING).substring(0, 8); server = mys...
class MySqlManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.EUROPE_WEST; private String resourceGroupName = "rg" + randomPadding(); private MySqlManager mysqlManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
class MySqlManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.EUROPE_WEST; private String resourceGroupName = "rg" + randomPadding(); private MySqlManager mysqlManager; private ResourceManager resourceManager; private boolean testEnv; @Override...
same here for comment on password. we don't want user copy this and just use the password.
public void testCreateServer() { Server server = null; String randomPadding = randomPadding(); try { String serverName = "postgresql" + randomPadding; String saUserName = "sqlsa" + randomPadding; server = postgreSqlManager.servers() .define(serverName) .withRegion(REGION) .withExistingResourceGroup(resourceGroupName) ....
.withAdministratorLoginPassword("!QA2ws
public void testCreateServer() { Server server = null; String randomPadding = randomPadding(); try { String serverName = "postgresql" + randomPadding; String adminName = "sqlAdmin" + randomPadding; String adminPwd = "sqlAdmin" + UUID.randomUUID().toString().replace("-", StringUtil.EMPTY_STRING).substring(0, 8); server ...
class PostgreSqlManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.EUROPE_WEST; private String resourceGroupName = "rg" + randomPadding(); private PostgreSqlManager postgreSqlManager; private ResourceManager resourceManager; private boolean tes...
class PostgreSqlManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.EUROPE_WEST; private String resourceGroupName = "rg" + randomPadding(); private PostgreSqlManager postgreSqlManager; private ResourceManager resourceManager; private boolean tes...
The password setting has been changed to randomly generated.
public void testCreateServer() { Server server = null; String randomPadding = randomPadding(); try { String serverName = "postgresql" + randomPadding; String saUserName = "sqlsa" + randomPadding; server = postgreSqlManager.servers() .define(serverName) .withRegion(REGION) .withExistingResourceGroup(resourceGroupName) ....
.withAdministratorLoginPassword("!QA2ws
public void testCreateServer() { Server server = null; String randomPadding = randomPadding(); try { String serverName = "postgresql" + randomPadding; String adminName = "sqlAdmin" + randomPadding; String adminPwd = "sqlAdmin" + UUID.randomUUID().toString().replace("-", StringUtil.EMPTY_STRING).substring(0, 8); server ...
class PostgreSqlManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.EUROPE_WEST; private String resourceGroupName = "rg" + randomPadding(); private PostgreSqlManager postgreSqlManager; private ResourceManager resourceManager; private boolean tes...
class PostgreSqlManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.EUROPE_WEST; private String resourceGroupName = "rg" + randomPadding(); private PostgreSqlManager postgreSqlManager; private ResourceManager resourceManager; private boolean tes...
`@embedmeEnd` If there was difference in your previous PR, please fix them as well. They would be rendered here e.g. https://github.com/azure/azure-sdk-for-java/tree/main/sdk/databricks/azure-resourcemanager-databricks#examples
public void testCreate() { Cluster cluster = null; try { String clusterName = "cluster" + randomPadding(); cluster = redisEnterpriseManager.redisEnterprises() .define(clusterName) .withRegion(REGION) .withExistingResourceGroup(resourceGroupName) .withSku(new Sku().withName(SkuName.ENTERPRISE_E10).withCapacity(2)) .with...
public void testCreate() { Cluster cluster = null; try { String clusterName = "cluster" + randomPadding(); cluster = redisEnterpriseManager.redisEnterprises() .define(clusterName) .withRegion(REGION) .withExistingResourceGroup(resourceGroupName) .withSku(new Sku().withName(SkuName.ENTERPRISE_E10).withCapacity(2)) .with...
class RedisEnterpriseManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private RedisEnterpriseManager redisEnterpriseManager; private ResourceManager resourceManager; private...
class RedisEnterpriseManagerTests extends TestBase { private static final Random RANDOM = new Random(); private static final Region REGION = Region.US_WEST2; private String resourceGroupName = "rg" + randomPadding(); private RedisEnterpriseManager redisEnterpriseManager; private ResourceManager resourceManager; private...