Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the project to use JUnit 5 instead of JUnit 4 #185

Merged
merged 1 commit into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 0 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ dependencies {
compile 'com.google.code.gson:gson:2.8.0'
compile group: 'org.apache.commons', name: 'commons-collections4', version: '4.0'

// TODO: to remove Junit4 after all tests are migrated to Junit5
compile 'junit:junit:4.13'
testCompile "junit:junit:4.13.1"

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'

Expand Down
12 changes: 6 additions & 6 deletions src/test/java/com/fishercoder/firstthousand/_100Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
import com.fishercoder.common.classes.TreeNode;
import com.fishercoder.common.utils.TreeUtils;
import com.fishercoder.solutions.firstthousand._100;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.util.Arrays;

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

public class _100Test {
private static _100.Solution1 solution1;
private _100.Solution1 solution1;
private static TreeNode p;
private static TreeNode q;

@BeforeClass
public static void setup() {
@BeforeEach
public void setup() {
solution1 = new _100.Solution1();
}

Expand Down
14 changes: 7 additions & 7 deletions src/test/java/com/fishercoder/firstthousand/_101Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@

import java.util.Arrays;

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

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

public class _101Test {
private static _101.Solution1 solution1;
private static _101.Solution2 solution2;
private _101.Solution1 solution1;
private _101.Solution2 solution2;
private static TreeNode root;

@BeforeClass
public static void setup() {
@BeforeEach
public void setup() {
solution1 = new _101.Solution1();
solution2 = new _101.Solution2();
}
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/com/fishercoder/firstthousand/_102Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
import com.fishercoder.common.utils.CommonUtils;
import com.fishercoder.common.utils.TreeUtils;
import com.fishercoder.solutions.firstthousand._102;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.util.Arrays;

public class _102Test {
private static _102.Solution1 solution1;
private _102.Solution1 solution1;
private static TreeNode treeRoot;

@BeforeClass
public static void setup() {
@BeforeEach
public void setup() {
solution1 = new _102.Solution1();
}

Expand Down
10 changes: 5 additions & 5 deletions src/test/java/com/fishercoder/firstthousand/_103Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
import com.fishercoder.common.utils.CommonUtils;
import com.fishercoder.common.utils.TreeUtils;
import com.fishercoder.solutions.firstthousand._103;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.util.Arrays;

public class _103Test {
private static _103.Solution1 solution1;
private _103.Solution1 solution1;
private static TreeNode root;

@BeforeClass
public static void setup() {
@BeforeEach
public void setup() {
solution1 = new _103.Solution1();
}

Expand Down
14 changes: 7 additions & 7 deletions src/test/java/com/fishercoder/firstthousand/_104Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@

import java.util.Arrays;

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

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

public class _104Test {
private static _104.Solution1 solution1;
private static _104.Solution2 solution2;
private _104.Solution1 solution1;
private _104.Solution2 solution2;
private static TreeNode root;

@BeforeClass
public static void setup() {
@BeforeEach
public void setup() {
solution1 = new _104.Solution1();
solution2 = new _104.Solution2();
}
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/com/fishercoder/firstthousand/_105Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@

import java.util.Arrays;

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

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

public class _105Test {
private static _105.Solution1 solution1;
private _105.Solution1 solution1;
private static TreeNode expected;
private static TreeNode actual;
private static int[] preorder;
private static int[] inorder;

@BeforeClass
public static void setup() {
@BeforeEach
public void setup() {
solution1 = new _105.Solution1();
}

Expand Down
14 changes: 7 additions & 7 deletions src/test/java/com/fishercoder/firstthousand/_106Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
import com.fishercoder.common.classes.TreeNode;
import com.fishercoder.common.utils.TreeUtils;
import com.fishercoder.solutions.firstthousand._106;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.util.Arrays;

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

public class _106Test {
private static _106.Solution1 solution1;
private static _106.Solution2 solution2;
private _106.Solution1 solution1;
private _106.Solution2 solution2;
private static TreeNode expected;
private static TreeNode actual;
private static int[] inorder;
private static int[] postorder;

@BeforeClass
public static void setup() {
@BeforeEach
public void setup() {
solution1 = new _106.Solution1();
solution2 = new _106.Solution2();
}
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/com/fishercoder/firstthousand/_107Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
import com.fishercoder.common.utils.CommonUtils;
import com.fishercoder.common.utils.TreeUtils;
import com.fishercoder.solutions.firstthousand._107;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.util.Arrays;

public class _107Test {
private static _107.Solution1 solution1;
private _107.Solution1 solution1;
private static TreeNode root;

@BeforeClass
public static void setup() {
@BeforeEach
public void setup() {
solution1 = new _107.Solution1();
}

Expand Down
10 changes: 5 additions & 5 deletions src/test/java/com/fishercoder/firstthousand/_108Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

import com.fishercoder.common.utils.TreeUtils;
import com.fishercoder.solutions.firstthousand._108;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class _108Test {
private static _108.Solution1 solution1;
private _108.Solution1 solution1;
private static int[] nums;

@BeforeClass
public static void setup() {
@BeforeEach
public void setup() {
solution1 = new _108.Solution1();
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/fishercoder/firstthousand/_109Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import java.util.Arrays;

public class _109Test {
private static _109.Solution1 solution1;
private _109.Solution1 solution1;
private static ListNode head;
private static TreeNode expected;

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/fishercoder/firstthousand/_10Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

public class _10Test {
private static _10.Solution1 solution1;
private _10.Solution1 solution1;

@BeforeEach
public void setup() {
Expand Down
14 changes: 7 additions & 7 deletions src/test/java/com/fishercoder/firstthousand/_110Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
import com.fishercoder.common.classes.TreeNode;
import com.fishercoder.common.utils.TreeUtils;
import com.fishercoder.solutions.firstthousand._110;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.util.Arrays;

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

public class _110Test {
private static _110.Solution1 solution1;
private static _110.Solution2 solution2;
private _110.Solution1 solution1;
private _110.Solution2 solution2;
private static TreeNode treeNode;

@BeforeClass
public static void setup() {
@BeforeEach
public void setup() {
solution1 = new _110.Solution1();
solution2 = new _110.Solution2();
}
Expand Down
14 changes: 7 additions & 7 deletions src/test/java/com/fishercoder/firstthousand/_113Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
import com.fishercoder.common.classes.TreeNode;
import com.fishercoder.common.utils.TreeUtils;
import com.fishercoder.solutions.firstthousand._113;
import org.junit.BeforeClass;
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.List;

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

public class _113Test {
private static _113.Solution1 solution1;
private static _113.Solution2 solution2;
private _113.Solution1 solution1;
private _113.Solution2 solution2;
private static TreeNode root;
private static int sum;
private static List<List<Integer>> expected;

@BeforeClass
public static void setup() {
@BeforeEach
public void setup() {
solution1 = new _113.Solution1();
solution2 = new _113.Solution2();
}
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/com/fishercoder/firstthousand/_114Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
import com.fishercoder.common.classes.TreeNode;
import com.fishercoder.common.utils.TreeUtils;
import com.fishercoder.solutions.firstthousand._114;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.util.Arrays;

public class _114Test {
private static _114.Solution1 solution1;
private _114.Solution1 solution1;
private static TreeNode root;

@BeforeClass
public static void setup() {
@BeforeEach
public void setUp() {
solution1 = new _114.Solution1();
}

Expand Down
12 changes: 6 additions & 6 deletions src/test/java/com/fishercoder/firstthousand/_115Test.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package com.fishercoder.firstthousand;

import com.fishercoder.solutions.firstthousand._115;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

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

public class _115Test {
private static _115.Solution1 solution1;
private _115.Solution1 solution1;

@BeforeClass
public static void setup() {
@BeforeEach
public void setUp() {
solution1 = new _115.Solution1();
}

Expand Down
6 changes: 3 additions & 3 deletions src/test/java/com/fishercoder/firstthousand/_116Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import org.junit.jupiter.api.Test;

public class _116Test {
private static _116.Solution1 solution1;
private static _116.Solution2 solution2;
private static _116.Node root;
private _116.Solution1 solution1;
private _116.Solution2 solution2;
private _116.Node root;

@BeforeEach
public void setup() {
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/com/fishercoder/firstthousand/_117Test.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.fishercoder.firstthousand;

import com.fishercoder.solutions.firstthousand._117;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class _117Test {
private static _117.Solution1 solution1;
private static _117.Node root;
private _117.Solution1 solution1;
private _117.Node root;

@BeforeClass
public static void setup() {
@BeforeEach
public void setup() {
solution1 = new _117.Solution1();
}

Expand Down
Loading
Loading