Skip to content

Commit ceeef19

Browse files
committed
Updated tests, do not explicitly swallow exceptions
1 parent 9db71b4 commit ceeef19

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

core/auth/src/test/java/software/amazon/awssdk/auth/token/credentials/ProfileTokenProviderTest.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,11 @@ void resolveToken_profileFileSupplier_suppliesObjectPerCall() {
8989
ProfileTokenProvider provider =
9090
ProfileTokenProvider.builder().profileFile(supplier).profileName("sso").build();
9191

92-
try {
93-
Mockito.when(supplier.get()).thenReturn(file1);
94-
provider.resolveToken();
95-
} catch (IllegalArgumentException e) {
96-
}
97-
98-
try {
99-
Mockito.when(supplier.get()).thenReturn(file2);
100-
provider.resolveToken();
101-
} catch (IllegalArgumentException e) {
102-
}
92+
Mockito.when(supplier.get()).thenReturn(file1);
93+
assertThatThrownBy(provider::resolveToken);
94+
95+
Mockito.when(supplier.get()).thenReturn(file2);
96+
assertThatThrownBy(provider::resolveToken);
10397

10498
Mockito.verify(supplier, Mockito.times(2)).get();
10599
}

0 commit comments

Comments
 (0)