Skip to content

Commit e2555c2

Browse files
authored
BAEL-870: Switch from TestNG to JUnit to fix broken build (eugenp#1787)
* Add files via upload * Update pom.xml * Update RunGuice.java * Update Communication.java * Update CommunicationMode.java * Update DefaultCommunicator.java * Update EmailCommunicationMode.java * Update IMCommunicationMode.java * Update SMSCommunicationMode.java * Update MessageLogger.java * Update MessageSentLoggable.java * Update AOPModule.java * Update BasicModule.java * Update CommunicationModel.java * Update Communicator.java * Update BasicModule.java * Update RunGuice.java * Update MessageLogger.java * Update Communicator.java * Update pom.xml * BAEL-278: Updated README.md * BAEL-554: Add and update README.md files * Update pom.xml * Update pom.xml * Update pom.xml * BAEL-345: fixed assertion * BAEL-109: Updated README.md * BAEL-345: Added README.md * Reinstating reactor-core module in root-level pom * BAEL-393: Adding guide-intro module to root pom * BAEL-9: Updated README.md * BAEL-157: README.md updated * Changed project name * Update RunGuice.java Removed references to message logging and output * Update Communication.java Removed message logging-related code * BAEL-566: Updated README.md * New project name * BAEL-393: removing guice-intro directory * BAEL-393: renamed module guice-intro to guice in root pom.xml * BAEL-393 and BAEL-541 README.md files * BAEL-731: Updated README.md * BAEL-680: renamed test methods * BAEL-714: Updated README.md * BAEL-737: Updated README.md * BAEL-680 and BAEL-756 README.md updates * BAEL-666: Updated README * BAEL-415: Custom Scope * BAEL-415: Custom Scope - renamed classes to reflect TenantScope * README file updates for BAEL-723, BAEL-763, and BAEL-415 * BAEL-735: README * BAEL-567: README * BAEL-736: README * BAEL-766: Update README * BAEL-555: README update * BAEL-761: README update * BAEL-742: Stripe API for Java README file * BAEL-86: Correction to README file * BAEL-828: Updated README.md * BAEL-830: Updated README * BAEL-870: Switched from TestNG to JUnit due to build errors
1 parent 86a893d commit e2555c2

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

‎core-java/pom.xml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,6 @@
395395
<org.hamcrest.version>1.3</org.hamcrest.version>
396396
<junit.version>4.12</junit.version>
397397
<mockito.version>1.10.19</mockito.version>
398-
<testng.version>6.10</testng.version>
399398
<assertj.version>3.6.1</assertj.version>
400399
<avaitility.version>1.7.0</avaitility.version>
401400

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
package com.baeldung.java.reflection;
22

3+
import static org.hamcrest.CoreMatchers.equalTo;
4+
import static org.junit.Assert.assertFalse;
5+
import static org.junit.Assert.assertThat;
6+
37
import java.lang.reflect.InvocationTargetException;
48
import java.lang.reflect.Method;
5-
import org.testng.Assert;
6-
import org.testng.annotations.Test;
9+
10+
import org.junit.Test;
711

812
public class OperationsUnitTest {
913

1014
public OperationsUnitTest() {
1115
}
1216

13-
@Test(expectedExceptions = IllegalAccessException.class)
17+
@Test(expected=IllegalAccessException.class)
1418
public void givenObject_whenInvokePrivatedMethod_thenFail() throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException{
1519
Method andInstanceMethod = Operations.class.getDeclaredMethod("and", boolean.class, boolean.class);
1620

1721
Operations operationsInstance = new Operations();
1822
Boolean result = (Boolean)andInstanceMethod.invoke(operationsInstance, true, false);
1923

20-
Assert.assertFalse(result);
24+
assertFalse(result);
2125
}
2226

2327
@Test
@@ -28,7 +32,7 @@ public void givenObject_whenInvokePrivateMethod_thenCorrect() throws Exception {
2832
Operations operationsInstance = new Operations();
2933
Boolean result = (Boolean)andInstanceMethod.invoke(operationsInstance, true, false);
3034

31-
Assert.assertFalse(result);
35+
assertFalse(result);
3236
}
3337

3438
@Test
@@ -38,7 +42,7 @@ public void givenObject_whenInvokePublicMethod_thenCorrect() throws Exception {
3842
Operations operationsInstance = new Operations();
3943
Double result = (Double)sumInstanceMethod.invoke(operationsInstance, 1, 3);
4044

41-
Assert.assertTrue(4 == result);
45+
assertThat(result, equalTo(4.0));
4246
}
4347

4448
@Test
@@ -47,7 +51,7 @@ public void givenObject_whenInvokeStaticMethod_thenCorrect() throws Exception {
4751

4852
Double result = (Double)multiplyStaticMethod.invoke(null, 3.5f, 2);
4953

50-
Assert.assertTrue(7 == result);
54+
assertThat(result, equalTo(7.0));
5155
}
5256

5357
}

0 commit comments

Comments
 (0)