Build opt 22 06 (#2132)
* Drools reformat * Further refactor * Further refactor * Refactor
This commit is contained in:
committed by
GitHub
parent
38dc2041a1
commit
87049b63f4
@@ -1,13 +1,12 @@
|
||||
package com.baeldung.junitparams;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import junitparams.FileParameters;
|
||||
import junitparams.JUnitParamsRunner;
|
||||
import junitparams.Parameters;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@RunWith(JUnitParamsRunner.class)
|
||||
public class SafeAdditionUtilTest {
|
||||
@@ -15,7 +14,7 @@ public class SafeAdditionUtilTest {
|
||||
private SafeAdditionUtil serviceUnderTest = new SafeAdditionUtil();
|
||||
|
||||
@Test
|
||||
@Parameters({ "1, 2, 3", "-10, 30, 20", "15, -5, 10", "-5, -10, -15" })
|
||||
@Parameters({"1, 2, 3", "-10, 30, 20", "15, -5, 10", "-5, -10, -15"})
|
||||
public void whenCalledWithAnnotationProvidedParams_thenSafeAddAndReturn(int a, int b, int expectedValue) {
|
||||
assertEquals(expectedValue, serviceUnderTest.safeAdd(a, b));
|
||||
}
|
||||
@@ -27,7 +26,7 @@ public class SafeAdditionUtilTest {
|
||||
}
|
||||
|
||||
private Object[] parametersToTestAdd() {
|
||||
return new Object[] { new Object[] { 1, 2, 3 }, new Object[] { -10, 30, 20 }, new Object[] { Integer.MAX_VALUE, 2, Integer.MAX_VALUE }, new Object[] { Integer.MIN_VALUE, -8, Integer.MIN_VALUE } };
|
||||
return new Object[]{new Object[]{1, 2, 3}, new Object[]{-10, 30, 20}, new Object[]{Integer.MAX_VALUE, 2, Integer.MAX_VALUE}, new Object[]{Integer.MIN_VALUE, -8, Integer.MIN_VALUE}};
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -37,7 +36,7 @@ public class SafeAdditionUtilTest {
|
||||
}
|
||||
|
||||
private Object[] parametersForWhenCalledWithnoParam_thenLoadByNameSafeAddAndReturn() {
|
||||
return new Object[] { new Object[] { 1, 2, 3 }, new Object[] { -10, 30, 20 }, new Object[] { Integer.MAX_VALUE, 2, Integer.MAX_VALUE }, new Object[] { Integer.MIN_VALUE, -8, Integer.MIN_VALUE } };
|
||||
return new Object[]{new Object[]{1, 2, 3}, new Object[]{-10, 30, 20}, new Object[]{Integer.MAX_VALUE, 2, Integer.MAX_VALUE}, new Object[]{Integer.MIN_VALUE, -8, Integer.MIN_VALUE}};
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -3,11 +3,11 @@ package com.baeldung.junitparams;
|
||||
public class TestDataProvider {
|
||||
|
||||
public static Object[] provideBasicData() {
|
||||
return new Object[] { new Object[] { 1, 2, 3 }, new Object[] { -10, 30, 20 }, new Object[] { 15, -5, 10 }, new Object[] { -5, -10, -15 } };
|
||||
return new Object[]{new Object[]{1, 2, 3}, new Object[]{-10, 30, 20}, new Object[]{15, -5, 10}, new Object[]{-5, -10, -15}};
|
||||
}
|
||||
|
||||
public static Object[] provideEdgeCaseData() {
|
||||
return new Object[] { new Object[] { Integer.MAX_VALUE, 2, Integer.MAX_VALUE }, new Object[] { Integer.MIN_VALUE, -2, Integer.MIN_VALUE }, };
|
||||
return new Object[]{new Object[]{Integer.MAX_VALUE, 2, Integer.MAX_VALUE}, new Object[]{Integer.MIN_VALUE, -2, Integer.MIN_VALUE},};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user