From e2555c2210a015bb3c89e4470890a6bf0454bf3a Mon Sep 17 00:00:00 2001 From: KevinGilmore Date: Fri, 5 May 2017 07:40:24 -0500 Subject: [PATCH] BAEL-870: Switch from TestNG to JUnit to fix broken build (#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 --- core-java/pom.xml | 1 - .../java/reflection/OperationsUnitTest.java | 18 +++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/core-java/pom.xml b/core-java/pom.xml index 1f5897ee2d..633687bde0 100644 --- a/core-java/pom.xml +++ b/core-java/pom.xml @@ -395,7 +395,6 @@ 1.3 4.12 1.10.19 - 6.10 3.6.1 1.7.0 diff --git a/core-java/src/test/java/com/baeldung/java/reflection/OperationsUnitTest.java b/core-java/src/test/java/com/baeldung/java/reflection/OperationsUnitTest.java index da0b436275..4bd12047c6 100644 --- a/core-java/src/test/java/com/baeldung/java/reflection/OperationsUnitTest.java +++ b/core-java/src/test/java/com/baeldung/java/reflection/OperationsUnitTest.java @@ -1,23 +1,27 @@ package com.baeldung.java.reflection; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertThat; + import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import org.testng.Assert; -import org.testng.annotations.Test; + +import org.junit.Test; public class OperationsUnitTest { public OperationsUnitTest() { } - @Test(expectedExceptions = IllegalAccessException.class) + @Test(expected=IllegalAccessException.class) public void givenObject_whenInvokePrivatedMethod_thenFail() throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException{ Method andInstanceMethod = Operations.class.getDeclaredMethod("and", boolean.class, boolean.class); Operations operationsInstance = new Operations(); Boolean result = (Boolean)andInstanceMethod.invoke(operationsInstance, true, false); - Assert.assertFalse(result); + assertFalse(result); } @Test @@ -28,7 +32,7 @@ public class OperationsUnitTest { Operations operationsInstance = new Operations(); Boolean result = (Boolean)andInstanceMethod.invoke(operationsInstance, true, false); - Assert.assertFalse(result); + assertFalse(result); } @Test @@ -38,7 +42,7 @@ public class OperationsUnitTest { Operations operationsInstance = new Operations(); Double result = (Double)sumInstanceMethod.invoke(operationsInstance, 1, 3); - Assert.assertTrue(4 == result); + assertThat(result, equalTo(4.0)); } @Test @@ -47,7 +51,7 @@ public class OperationsUnitTest { Double result = (Double)multiplyStaticMethod.invoke(null, 3.5f, 2); - Assert.assertTrue(7 == result); + assertThat(result, equalTo(7.0)); } }