Skip to content

Commit 5b350cf

Browse files
committed
adding extra assertion
1 parent 096eb42 commit 5b350cf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

agent/agent-tooling/src/test/java/com/microsoft/applicationinsights/agent/internal/profiler/config/ProfilerConfigurationTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.fasterxml.jackson.core.JsonProcessingException;
1010
import com.fasterxml.jackson.databind.DeserializationFeature;
1111
import com.fasterxml.jackson.databind.ObjectMapper;
12+
import com.microsoft.applicationinsights.alerting.aiconfig.AlertingConfig;
1213
import java.io.IOException;
1314
import java.io.InputStreamReader;
1415
import java.nio.charset.Charset;
@@ -67,8 +68,13 @@ public void testAlertDeserialization() {
6768

6869
JsonReader reader = DefaultJsonReader.fromReader(json, new JsonOptions());
6970
ProfilerConfiguration profilerConfiguration = ProfilerConfiguration.fromJson(reader);
70-
7171
Assertions.assertTrue(profilerConfiguration != null);
72+
AlertingConfig.RequestTrigger requestTrigger =
73+
profilerConfiguration.getRequestTriggerConfiguration().get(0);
74+
Assertions.assertEquals(requestTrigger.getType(), AlertingConfig.RequestTriggerType.LATENCY);
75+
Assertions.assertEquals(
76+
requestTrigger.getFilter().getType(), AlertingConfig.RequestFilterType.NAME_REGEX);
77+
Assertions.assertEquals(requestTrigger.getFilter().getValue(), ".*");
7278
} catch (IOException e) {
7379
throw new RuntimeException(e);
7480
}

0 commit comments

Comments
 (0)