Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
srnagar committed Jun 7, 2021
1 parent a817952 commit 2cfdedd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
public class LogsQueryClientTest extends TestBase {

public static final String WORKSPACE_ID = Configuration.getGlobalConfiguration()
.get("AZURE_MONITOR_LOGS_WORKSPACE_ID");
.get("AZURE_MONITOR_LOGS_WORKSPACE_ID", "d2d0e126-fa1e-4b0a-b647-250cdd471e68");
private LogsQueryClient client;

@BeforeEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
import reactor.core.publisher.Mono;

import java.time.Duration;
import java.time.LocalDateTime;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.util.Arrays;
import java.util.List;

Expand All @@ -39,7 +41,8 @@
*/
public class MetricsQueryClientTest extends TestBase {
public static final String RESOURCE_URI = Configuration.getGlobalConfiguration()
.get("AZURE_MONITOR_METRICS_RESOURCE_URI");
.get("AZURE_MONITOR_METRICS_RESOURCE_URI",
"/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/srnagar-azuresdkgroup/providers/Microsoft.CognitiveServices/accounts/srnagara-textanalytics");
private MetricsQueryClient client;

@BeforeEach
Expand Down Expand Up @@ -107,7 +110,7 @@ public void testMetricsDefinition() {
@Test
public void testMetricsNamespaces() {
PagedIterable<MetricNamespace> metricsNamespaces = client.listMetricsNamespace(RESOURCE_URI,
OffsetDateTime.now().minusMonths(2));
OffsetDateTime.of(LocalDateTime.of(2021, 06, 01, 0, 0), ZoneOffset.UTC));
assertEquals(2, metricsNamespaces.stream().count());
}
}
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"networkCallRecords" : [ {
"Method" : "GET",
"Uri" : "https://REDACTED.azure.com/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/srnagar-azuresdkgroup/providers/Microsoft.CognitiveServices/accounts/srnagara-textanalytics/providers/microsoft.insights/metricNamespaces?api-version=2017-12-01-preview&startTime=2021-04-06T21%3A58%3A07.666370700-07%3A00",
"Uri" : "https://REDACTED.azure.com//subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/srnagar-azuresdkgroup/providers/Microsoft.CognitiveServices/accounts/srnagara-textanalytics/providers/microsoft.insights/metricNamespaces?api-version=2017-12-01-preview&startTime=2021-06-01T00%3A00Z",
"Headers" : {
"User-Agent" : "azsdk-java-UnknownName/UnknownVersion (11.0.8; Windows 10; 10.0)"
"User-Agent" : "azsdk-java-UnknownName/UnknownVersion (14.0.2; Windows 10; 10.0)"
},
"Response" : {
"content-length" : "829",
"Server" : "Microsoft-IIS/10.0",
"X-Content-Type-Options" : "nosniff",
"retry-after" : "0",
"x-ms-ratelimit-remaining-subscription-reads" : "11997",
"x-ms-ratelimit-remaining-subscription-reads" : "11999",
"StatusCode" : "200",
"x-ms-correlation-request-id" : "d3fdef0c-9f7d-41bc-b2fe-4041f97fb031",
"Date" : "Mon, 07 Jun 2021 04:58:06 GMT",
"x-ms-correlation-request-id" : "41c50e57-6857-4ba3-b6e6-c1a5ad6c1143",
"Date" : "Mon, 07 Jun 2021 17:38:44 GMT",
"Access-Control-Expose-Headers" : "Request-Context",
"Strict-Transport-Security" : "max-age=31536000; includeSubDomains",
"Cache-Control" : "no-cache",
"x-ms-routing-request-id" : "WESTUS2:20210607T045807Z:d3fdef0c-9f7d-41bc-b2fe-4041f97fb031",
"x-ms-routing-request-id" : "WESTUS2:20210607T173845Z:41c50e57-6857-4ba3-b6e6-c1a5ad6c1143",
"Vary" : "Accept-Encoding",
"x-ms-request-id" : "{d3fdef0c-9f7d-41bc-b2fe-4041f97fb031}",
"x-ms-request-id" : "{41c50e57-6857-4ba3-b6e6-c1a5ad6c1143}",
"Body" : "{\"value\":[{\"id\":\"/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/srnagar-azuresdkgroup/providers/Microsoft.CognitiveServices/accounts/srnagara-textanalytics/providers/microsoft.insights/metricNamespaces/newNamespace\",\"name\":\"newNamespace\",\"type\":\"Microsoft.Insights/metricNamespaces\",\"classification\":\"Custom\",\"properties\":{\"metricNamespaceName\":\"newNamespace\"}},{\"id\":\"/subscriptions/faa080af-c1d8-40ad-9cce-e1a450ca5b57/resourceGroups/srnagar-azuresdkgroup/providers/Microsoft.CognitiveServices/accounts/srnagara-textanalytics/providers/microsoft.insights/metricNamespaces/Microsoft.CognitiveServices-accounts\",\"name\":\"Microsoft.CognitiveServices-accounts\",\"type\":\"Microsoft.Insights/metricNamespaces\",\"classification\":\"Platform\",\"properties\":{\"metricNamespaceName\":\"Microsoft.CognitiveServices/accounts\"}}]}",
"Content-Type" : "application/json",
"Request-Context" : "appId=cid-v1:b021da79-5252-4375-9df5-2e17c1dcd822",
Expand Down

0 comments on commit 2cfdedd

Please sign in to comment.