Skip to content

Commit a64d35c

Browse files
authored
refactor: migration tests in credentials module from JUnit4 to JUnit5 (googleapis#756) (googleapis#761)
1 parent cccaa44 commit a64d35c

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

credentials/javatests/com/google/auth/SigningExceptionTest.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,45 +31,44 @@
3131

3232
package com.google.auth;
3333

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;
3838

3939
import com.google.auth.ServiceAccountSigner.SigningException;
40-
import java.io.IOException;
41-
import org.junit.Test;
40+
import org.junit.jupiter.api.Test;
4241

43-
public class SigningExceptionTest {
42+
class SigningExceptionTest {
4443

4544
private static final String EXPECTED_MESSAGE = "message";
4645
private static final RuntimeException EXPECTED_CAUSE = new RuntimeException();
4746

4847
@Test
49-
public void constructor() {
48+
void constructor() {
5049
SigningException signingException = new SigningException(EXPECTED_MESSAGE, EXPECTED_CAUSE);
5150
assertEquals(EXPECTED_MESSAGE, signingException.getMessage());
5251
assertSame(EXPECTED_CAUSE, signingException.getCause());
5352
}
5453

5554
@Test
56-
public void equals_true() throws IOException {
55+
void equals_true() {
5756
SigningException signingException = new SigningException(EXPECTED_MESSAGE, EXPECTED_CAUSE);
5857
SigningException otherSigningException = new SigningException(EXPECTED_MESSAGE, EXPECTED_CAUSE);
5958
assertTrue(signingException.equals(otherSigningException));
6059
assertTrue(otherSigningException.equals(signingException));
6160
}
6261

6362
@Test
64-
public void equals_false_message() throws IOException {
63+
void equals_false_message() {
6564
SigningException signingException = new SigningException(EXPECTED_MESSAGE, EXPECTED_CAUSE);
6665
SigningException otherSigningException = new SigningException("otherMessage", EXPECTED_CAUSE);
6766
assertFalse(signingException.equals(otherSigningException));
6867
assertFalse(otherSigningException.equals(signingException));
6968
}
7069

7170
@Test
72-
public void equals_false_cause() throws IOException {
71+
void equals_false_cause() {
7372
SigningException signingException = new SigningException(EXPECTED_MESSAGE, EXPECTED_CAUSE);
7473
SigningException otherSigningException =
7574
new SigningException("otherMessage", new RuntimeException());
@@ -78,7 +77,7 @@ public void equals_false_cause() throws IOException {
7877
}
7978

8079
@Test
81-
public void hashCode_equals() throws IOException {
80+
void hashCode_equals() {
8281
SigningException signingException = new SigningException(EXPECTED_MESSAGE, EXPECTED_CAUSE);
8382
SigningException otherSigningException = new SigningException(EXPECTED_MESSAGE, EXPECTED_CAUSE);
8483
assertEquals(signingException.hashCode(), otherSigningException.hashCode());

credentials/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050

5151
<dependencies>
5252
<dependency>
53-
<groupId>junit</groupId>
54-
<artifactId>junit</artifactId>
53+
<groupId>org.junit.jupiter</groupId>
54+
<artifactId>junit-jupiter-api</artifactId>
5555
<scope>test</scope>
5656
</dependency>
5757
</dependencies>

0 commit comments

Comments
 (0)