Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2383,82 +2383,7 @@
<Method name="getUserName" />
<Bug pattern="NM_CONFUSING" />
</Match>


<!-- id field is set in AnomalyDetectionConfiguration using PrivateFieldAccessHelper -->
<Match>
<Class name="com.azure.ai.metricsadvisor.models.AnomalyDetectionConfiguration"/>
<Field name="id"/>
<Bug pattern="UWF_UNWRITTEN_FIELD"/>
</Match>

<!-- metricId field is set in AnomalyDetectionConfiguration using PrivateFieldAccessHelper -->
<Match>
<Class name="com.azure.ai.metricsadvisor.models.AnomalyDetectionConfiguration"/>
<Field name="metricId"/>
<Bug pattern="UWF_UNWRITTEN_FIELD"/>
</Match>

<!-- id field is set in HookTransforms using PrivateFieldAccessHelper -->
<Match>
<Class name="com.azure.ai.metricsadvisor.models.WebHook"/>
<Field name="id"/>
<Bug pattern="UWF_UNWRITTEN_FIELD"/>
</Match>

<!-- admins field is set in HookTransforms using PrivateFieldAccessHelper -->
<Match>
<Class name="com.azure.ai.metricsadvisor.models.WebHook"/>
<Field name="admins"/>
<Bug pattern="UWF_UNWRITTEN_FIELD"/>
</Match>

<!-- id field is set in HookTransforms using PrivateFieldAccessHelper -->
<Match>
<Class name="com.azure.ai.metricsadvisor.models.EmailHook"/>
<Field name="id"/>
<Bug pattern="UWF_UNWRITTEN_FIELD"/>
</Match>

<!-- admins field is set in HookTransforms using PrivateFieldAccessHelper -->
<Match>
<Class name="com.azure.ai.metricsadvisor.models.EmailHook"/>
<Field name="admins"/>
<Bug pattern="UWF_UNWRITTEN_FIELD"/>
</Match>

<!-- All field in set in MetricSeriesData are set using PrivateFieldAccessHelper -->
<Match>
<Class name="com.azure.ai.metricsadvisor.models.MetricSeriesData" />
<Bug pattern="UWF_UNWRITTEN_FIELD" />
</Match>

<!-- id field is set in AnomalyAlertConfiguration using PrivateFieldAccessHelper -->
<Match>
<Class name="com.azure.ai.metricsadvisor.models.AnomalyAlertConfiguration" />
<Field name="id" />
<Bug pattern="UWF_UNWRITTEN_FIELD" />
</Match>

<!-- All fields in IncidentRootCause are set using PrivateFieldAccessHelper -->
<Match>
<Class name="com.azure.ai.metricsadvisor.models.IncidentRootCause" />
<Bug pattern="UWF_UNWRITTEN_FIELD" />
</Match>

<!-- All fields in MetricSeriesDefinition are set using PrivateFieldAccessHelper -->
<Match>
<Class name="com.azure.ai.metricsadvisor.models.MetricSeriesDefinition" />
<Bug pattern="UWF_UNWRITTEN_FIELD" />
</Match>

<!-- id field is set in MetricAnomalyFeedback using PrivateFieldAccessHelper -->
<Match>
<Class name="com.azure.ai.metricsadvisor.models.MetricAnomalyFeedback" />
<Field name="detectionConfiguration" />
<Bug pattern="UWF_UNWRITTEN_FIELD" />
</Match>


<!-- Disabling false positives in azure-core -->
<!-- This Issue has been resolved as per spotbugs's recommended solution but the static checker still flags it, its a known issue with this rule. -->
<Match>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private static Stream<Arguments> sensitiveDataSupplier() {
Arguments.of(USERNAME_RESPONSE_BODY, REDACTED_USERNAME_RESPONSE),
Arguments.of(REDACTED_EMPTY_KEY_RESPONSE_BODY, EMPTY_KEY_RESPONSE_BODY),
Arguments.of(NON_SENSITIVE_DATA_CONTENT, NON_SENSITIVE_DATA_CONTENT)
);
);
}


Expand Down
12 changes: 12 additions & 0 deletions sdk/metricsadvisor/azure-ai-metricsadvisor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@
</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-surefire-plugin;external_dependency} -->
<configuration>
<systemPropertyVariables>
<!-- Parallel runs disabled due to subscriber timeout issue causing failures in tests. -->
<!-- https://github.com/Azure/azure-sdk-for-java/issues/17069 -->
<junit.jupiter.execution.parallel.enabled>false</junit.jupiter.execution.parallel.enabled>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should leave a TODO to determine the root cause and fix this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#17069. Will add it to the code too.

</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ private Mono<PagedResponse<MetricSeriesData>> listMetricSeriesDataInternal(Strin
Objects.requireNonNull(options.getStartTime(), "'options.startTime' cannot be null.");
Objects.requireNonNull(options.getEndTime(), "'options.endTime' cannot be null.");
if (CoreUtils.isNullOrEmpty(seriesKeys)) {
Objects.requireNonNull(seriesKeys, "'metricId' cannot be null or empty.");
Objects.requireNonNull(seriesKeys, "'seriesKeys' cannot be null or empty.");
}

List<Map<String, String>> dimensionList =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public FeedbackQueryTimeMode getTimeMode() {
return this.timeMode;
}


/**
* Set the feedback dimension filter to filter the feedbacks.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ public void listAlerts(HttpClient httpClient, MetricsAdvisorServiceVersion servi
cnt[0]++;
assertAlertOutput(alert);
}
Assertions.assertEquals(3, cnt[0]);
Assertions.assertEquals(4, cnt[0]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,22 @@

public abstract class AlertTestBase extends MetricsAdvisorClientTestBase {
public abstract void listAlerts(HttpClient httpClient, MetricsAdvisorServiceVersion serviceVersion);
public static final String ALERT_CONFIG_ID = "204a211a-c5f4-45f3-a30e-512fb25d1d2c";

// Pre-configured test resource.
protected static class ListAlertsInput {
static final ListAlertsInput INSTANCE = new ListAlertsInput();
final OffsetDateTime startTime = OffsetDateTime.parse("2020-01-01T00:00:00Z");
final OffsetDateTime endTime = OffsetDateTime.parse("2020-09-09T00:00:00Z");
final OffsetDateTime startTime = OffsetDateTime.parse("2020-10-10T00:00:00Z");
final OffsetDateTime endTime = OffsetDateTime.parse("2020-10-21T00:00:00Z");
final TimeMode timeMode = TimeMode.ANOMALY_TIME;
final ListAlertOptions options = new ListAlertOptions(startTime, endTime, timeMode)
.setTop(10);
final String alertConfigurationId = "ff3014a0-bbbb-41ec-a637-677e77b81299";
final String alertConfigurationId = ALERT_CONFIG_ID;
}

protected static class ListAlertsOutput {
static final ListAlertsOutput INSTANCE = new ListAlertsOutput();
final int expectedAlerts = 3;
final int expectedAlerts = 4;
}

protected void assertAlertOutput(Alert alert) {
Expand Down
Loading