Skip to content

Commit ffa8a8d

Browse files
Copilottrask
andcommitted
Fix exception handling in updated Logback tests
Co-authored-by: trask <[email protected]>
1 parent 323f35e commit ffa8a8d

File tree

5 files changed

+5
-7
lines changed

5 files changed

+5
-7
lines changed

smoke-tests/apps/Logback/src/smokeTest/java/com/microsoft/applicationinsights/smoketest/LogbackDisabledTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void testDisabled() {
3333

3434
@Test
3535
@TargetUri("/testWithSpanException")
36-
void testWithSpanException() {
36+
void testWithSpanException() throws Exception {
3737
testing.waitAndAssertTrace(
3838
trace ->
3939
trace

smoke-tests/apps/Logback/src/smokeTest/java/com/microsoft/applicationinsights/smoketest/LogbackLevelOffTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void testDisabled() {
3333

3434
@Test
3535
@TargetUri("/testWithSpanException")
36-
void testWithSpanException() {
36+
void testWithSpanException() throws Exception {
3737
testing.waitAndAssertTrace(
3838
trace ->
3939
trace

smoke-tests/apps/Logback/src/smokeTest/java/com/microsoft/applicationinsights/smoketest/LogbackTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,13 @@ void test() {
9797
"com.microsoft.applicationinsights.smoketestapp.LogbackServlet")
9898
.hasProperty("MethodName", "doGet")
9999
.hasProperty("LineNumber", "28"))
100-
.hasMessageSatisying(
101-
message -> message.hasProperty("Marker", "aMarker")));
100+
.hasMessageSatisying(message -> message.hasProperty("Marker", "aMarker")));
102101
}
103102
}
104103

105104
@Test
106105
@TargetUri("/testWithException")
107-
void testWithException() {
106+
void testWithException() throws Exception {
108107
testing.waitAndAssertTrace(
109108
trace ->
110109
trace

smoke-tests/framework/src/main/java/com/microsoft/applicationinsights/smoketest/MessageAssert.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ private MessageData getMessageData() {
7878
Data<?> data = (Data<?>) actual.getData();
7979
return (MessageData) data.getBaseData();
8080
}
81-
}
81+
}

smoke-tests/framework/src/main/java/com/microsoft/applicationinsights/smoketest/TraceAssert.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import com.google.errorprone.annotations.CanIgnoreReturnValue;
1111
import com.microsoft.applicationinsights.smoketest.schemav2.Data;
1212
import com.microsoft.applicationinsights.smoketest.schemav2.Envelope;
13-
import com.microsoft.applicationinsights.smoketest.schemav2.MessageData;
1413
import com.microsoft.applicationinsights.smoketest.schemav2.RemoteDependencyData;
1514
import com.microsoft.applicationinsights.smoketest.schemav2.RequestData;
1615
import java.time.Instant;

0 commit comments

Comments
 (0)