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
This commit is contained in:
KevinGilmore 2017-05-05 07:40:24 -05:00 committed by GitHub
parent 86a893d454
commit e2555c2210
2 changed files with 11 additions and 8 deletions

View File

@ -395,7 +395,6 @@
<org.hamcrest.version>1.3</org.hamcrest.version>
<junit.version>4.12</junit.version>
<mockito.version>1.10.19</mockito.version>
<testng.version>6.10</testng.version>
<assertj.version>3.6.1</assertj.version>
<avaitility.version>1.7.0</avaitility.version>

View File

@ -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));
}
}