Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…o JUnit5
  • Loading branch information
ffafara-tw committed Sep 24, 2021
1 parent 2c616e6 commit 42473de
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 47 deletions.
20 changes: 2 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.8.0</version>
<version>5.8.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -54,23 +54,7 @@
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
12 changes: 7 additions & 5 deletions src/test/java/gov/va/vanotify/JsonUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@

import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.Before;
import org.junit.Test;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;

public class JsonUtilsTest {

private Map<String, Object> expectedMap;
private List<Object> expectedList;

@Before
@BeforeEach
public void setUp() {
setUpMap();
setUpList();
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/gov/va/vanotify/LetterResponseTest.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package gov.va.vanotify;

import org.json.JSONObject;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.Optional;
import java.util.UUID;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class LetterResponseTest {

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/gov/va/vanotify/NotificationListTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import org.jose4j.json.internal.json_simple.JSONArray;
import org.jose4j.json.internal.json_simple.JSONObject;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.Optional;
import java.util.UUID;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;


public class NotificationListTest {
Expand Down
5 changes: 3 additions & 2 deletions src/test/java/gov/va/vanotify/PdfUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.FileUtils;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.io.File;

import static java.nio.charset.StandardCharsets.US_ASCII;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class PdfUtilsTest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import org.jose4j.json.internal.json_simple.JSONArray;
import org.jose4j.json.internal.json_simple.JSONObject;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.Optional;
import java.util.UUID;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class ReceivedTextMessageListTest {

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/gov/va/vanotify/ReceivedTextMessageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import org.joda.time.DateTime;
import org.jose4j.json.internal.json_simple.JSONObject;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.UUID;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class ReceivedTextMessageTest {

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/gov/va/vanotify/SendEmailResponseTest.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package gov.va.vanotify;

import org.json.JSONObject;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.Optional;
import java.util.UUID;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class SendEmailResponseTest {

Expand Down
6 changes: 3 additions & 3 deletions src/test/java/gov/va/vanotify/SendLetterResponseTest.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package gov.va.vanotify;

import org.json.JSONObject;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.Optional;
import java.util.UUID;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;

public class SendLetterResponseTest {

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/gov/va/vanotify/SendSmsResponseTest.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package gov.va.vanotify;

import org.json.JSONObject;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.Optional;
import java.util.UUID;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class SendSmsResponseTest {

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/gov/va/vanotify/TemplatePreviewTest.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package gov.va.vanotify;

import org.jose4j.json.internal.json_simple.JSONObject;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.Optional;
import java.util.UUID;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class TemplatePreviewTest {

Expand Down
7 changes: 2 additions & 5 deletions src/test/java/gov/va/vanotify/TemplateTest.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package gov.va.vanotify;


import org.joda.time.DateTime;
import org.jose4j.json.internal.json_simple.JSONObject;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class TemplateTest {

Expand Down Expand Up @@ -55,8 +54,6 @@ public void testTemplate_canCreateObjectFromJson() {
assertEquals(Optional.of(expectedPersonalisation), template.getPersonalisation());
}



@Test
public void testTemplate_canCreateObjectFromJsonWithOptionals() {
JSONObject content = new JSONObject();
Expand Down

0 comments on commit 42473de

Please sign in to comment.