31
31
32
32
package com .google .auth ;
33
33
34
- import static org .junit .Assert .assertEquals ;
35
- import static org .junit .Assert .assertFalse ;
36
- import static org .junit .Assert .assertSame ;
37
- import static org .junit .Assert .assertTrue ;
34
+ import static org .junit .jupiter . api . Assertions .assertEquals ;
35
+ import static org .junit .jupiter . api . Assertions .assertFalse ;
36
+ import static org .junit .jupiter . api . Assertions .assertSame ;
37
+ import static org .junit .jupiter . api . Assertions .assertTrue ;
38
38
39
39
import com .google .auth .ServiceAccountSigner .SigningException ;
40
- import java .io .IOException ;
41
- import org .junit .Test ;
40
+ import org .junit .jupiter .api .Test ;
42
41
43
- public class SigningExceptionTest {
42
+ class SigningExceptionTest {
44
43
45
44
private static final String EXPECTED_MESSAGE = "message" ;
46
45
private static final RuntimeException EXPECTED_CAUSE = new RuntimeException ();
47
46
48
47
@ Test
49
- public void constructor () {
48
+ void constructor () {
50
49
SigningException signingException = new SigningException (EXPECTED_MESSAGE , EXPECTED_CAUSE );
51
50
assertEquals (EXPECTED_MESSAGE , signingException .getMessage ());
52
51
assertSame (EXPECTED_CAUSE , signingException .getCause ());
53
52
}
54
53
55
54
@ Test
56
- public void equals_true () throws IOException {
55
+ void equals_true () {
57
56
SigningException signingException = new SigningException (EXPECTED_MESSAGE , EXPECTED_CAUSE );
58
57
SigningException otherSigningException = new SigningException (EXPECTED_MESSAGE , EXPECTED_CAUSE );
59
58
assertTrue (signingException .equals (otherSigningException ));
60
59
assertTrue (otherSigningException .equals (signingException ));
61
60
}
62
61
63
62
@ Test
64
- public void equals_false_message () throws IOException {
63
+ void equals_false_message () {
65
64
SigningException signingException = new SigningException (EXPECTED_MESSAGE , EXPECTED_CAUSE );
66
65
SigningException otherSigningException = new SigningException ("otherMessage" , EXPECTED_CAUSE );
67
66
assertFalse (signingException .equals (otherSigningException ));
68
67
assertFalse (otherSigningException .equals (signingException ));
69
68
}
70
69
71
70
@ Test
72
- public void equals_false_cause () throws IOException {
71
+ void equals_false_cause () {
73
72
SigningException signingException = new SigningException (EXPECTED_MESSAGE , EXPECTED_CAUSE );
74
73
SigningException otherSigningException =
75
74
new SigningException ("otherMessage" , new RuntimeException ());
@@ -78,7 +77,7 @@ public void equals_false_cause() throws IOException {
78
77
}
79
78
80
79
@ Test
81
- public void hashCode_equals () throws IOException {
80
+ void hashCode_equals () {
82
81
SigningException signingException = new SigningException (EXPECTED_MESSAGE , EXPECTED_CAUSE );
83
82
SigningException otherSigningException = new SigningException (EXPECTED_MESSAGE , EXPECTED_CAUSE );
84
83
assertEquals (signingException .hashCode (), otherSigningException .hashCode ());
0 commit comments