Skip to content

Commit 29b3f37

Browse files
committed
Add an assertion that actual exception class matches expected in protocol tests
1 parent 3b54e5c commit 29b3f37

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/asserts/unmarshalling/UnmarshalledErrorAssertion.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package software.amazon.awssdk.protocol.asserts.unmarshalling;
1717

1818

19+
import static org.junit.Assert.assertEquals;
1920
import static org.junit.Assert.fail;
2021
import static org.unitils.reflectionassert.ReflectionAssert.assertReflectionEquals;
2122

@@ -39,6 +40,7 @@ protected void doAssert(UnmarshallingTestContext context, Object actual) throws
3940
}
4041
SdkServiceException actualException = (SdkServiceException) actual;
4142
SdkServiceException expectedException = createExpectedResult(context);
43+
assertEquals(expectedException.getClass(), actualException.getClass());
4244
for (Field field : expectedException.getClass().getDeclaredFields()) {
4345
assertFieldEquals(field, actualException, expectedException);
4446
}

0 commit comments

Comments
 (0)