diff --git a/build.gradle b/build.gradle index 77c0bf6f..ea68880b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,11 @@ buildscript { repositories { maven { - url "https://plugins.gradle.org/m2/" + url 'https://plugins.gradle.org/m2/' } } dependencies { - classpath "gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:1.6.2" + classpath 'gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:1.6.2' } } @@ -52,6 +52,11 @@ subprojects { group = 'com.tngtech.junit.dataprovider' version = '2.3' + tasks.withType(JavaCompile) { + options.encoding = 'UTF-8' + options.compilerArgs += [ '-Xlint:all', '-Werror' ] + } + tasks.withType(Jar) { from(project.rootDir) { include 'LICENSE.md', 'LICENSE-notice.md' @@ -77,6 +82,10 @@ project(':core') { testCompile group: 'org.mockito', name: 'mockito-core', version: '2.18.3' } + tasks.withType(JavaCompile) { + options.compilerArgs += [ '-Xlint:-options' ] + } + jar { manifest { attributes( @@ -119,6 +128,10 @@ project(':junit4') { integTestCompile group: 'org.codehaus.groovy', name: 'groovy', version: '2.4.7' } + tasks.withType(JavaCompile) { + options.compilerArgs += [ '-Xlint:-options' ] + } + jar { manifest { attributes( @@ -168,6 +181,10 @@ configure(subprojects.findAll{ p -> p.name.startsWith('junit-jupiter') }) { integTestCompile group: 'org.codehaus.groovy', name: 'groovy', version: '2.4.12' } + tasks.withType(JavaCompile) { + options.compilerArgs += [ '-parameters' ] + } + test { useJUnitPlatform() } @@ -219,10 +236,6 @@ project(':junit-jupiter-params') { // configure after properties are set and integration tests are added subprojects { - tasks.withType(JavaCompile) { - options.compilerArgs += [ "-parameters" ] - } - jar { manifest { def now = new Date() @@ -306,7 +319,7 @@ subprojects { } cpd { - if (System.getProperty("java.version")[0..2] in [ '1.6' ]) { // PMD / CPD v5.4.0 does not work with Java < v1.7 :-( + if (System.getProperty('java.version')[0..2] in [ '1.6' ]) { // PMD / CPD v5.4.0 does not work with Java < v1.7 :-( toolVersion = '5.3.7' } else { toolVersion = '6.2.0' diff --git a/core/src/test/java/com/tngtech/junit/dataprovider/convert/StringConverterTest.java b/core/src/test/java/com/tngtech/junit/dataprovider/convert/StringConverterTest.java index 447bed5e..79873513 100644 --- a/core/src/test/java/com/tngtech/junit/dataprovider/convert/StringConverterTest.java +++ b/core/src/test/java/com/tngtech/junit/dataprovider/convert/StringConverterTest.java @@ -103,7 +103,7 @@ public void testConvertShouldThrowExceptionIfVarargsAndNumberOfArgumentsIsTwoLes public void testConvertShouldCorrectlyParseAllPrimitiveTypes() { // Given: String data = "true,1,c,2,3,4,5.5,6.6"; - Class[] parameterTypes = new Class[] { boolean.class, byte.class, char.class, short.class, int.class, + Class[] parameterTypes = new Class[] { boolean.class, byte.class, char.class, short.class, int.class, long.class, float.class, double.class }; when(context.getSplitBy()).thenReturn(","); @@ -119,7 +119,7 @@ public void testConvertShouldCorrectlyParseAllPrimitiveTypes() { public void testConvertShouldCorrectlyParseAllPrimitiveTypesAsJavaString() { // Given: String data = "-5;2014l;-1.234567f;-901e-3"; - Class[] parameterTypes = new Class[] { int.class, long.class, float.class, double.class }; + Class[] parameterTypes = new Class[] { int.class, long.class, float.class, double.class }; when(context.getSplitBy()).thenReturn(";"); @@ -134,7 +134,7 @@ public void testConvertShouldCorrectlyParseAllPrimitiveTypesAsJavaString() { public void testConvertShouldNotTrimValuesIfSettingsTrimIsFalse() { // Given: String data = " foo| bar |baz "; - Class[] parameterTypes = new Class[] { String.class, String.class, String.class }; + Class[] parameterTypes = new Class[] { String.class, String.class, String.class }; when(context.getSplitBy()).thenReturn("\\|"); @@ -149,7 +149,7 @@ public void testConvertShouldNotTrimValuesIfSettingsTrimIsFalse() { public void testConvertShouldTrimAndParseAllPrimitiveTypesIfSettingsTrimIsTrue() { // Given: String data = " false ; 11 ; z ; 22 ; 33 ;44 ; 55.55 ; 66.66 "; - Class[] parameterTypes = new Class[] { boolean.class, byte.class, char.class, short.class, int.class, + Class[] parameterTypes = new Class[] { boolean.class, byte.class, char.class, short.class, int.class, long.class, float.class, double.class }; when(context.getSplitBy()).thenReturn(";"); @@ -166,7 +166,7 @@ public void testConvertShouldTrimAndParseAllPrimitiveTypesIfSettingsTrimIsTrue() public void testConvertShouldTrimNonSpaceWhitespaceCharsIfSettingsTrimIsTrue() { // Given: String data = "\n-1f\n,\r-2\r,\t3.0d\t"; - Class[] parameterTypes = new Class[] { float.class, int.class, double.class }; + Class[] parameterTypes = new Class[] { float.class, int.class, double.class }; when(context.getSplitBy()).thenReturn(","); when(context.isTrimValues()).thenReturn(true); @@ -182,7 +182,7 @@ public void testConvertShouldTrimNonSpaceWhitespaceCharsIfSettingsTrimIsTrue() { public void testConvertShouldNotTrimNonBreakingSpaceEvenIfSettingsTrimIsTrue() { // Given: String data = "\u00A0test\u00A0"; - Class[] parameterTypes = new Class[] { String.class }; + Class[] parameterTypes = new Class[] { String.class }; when(context.isTrimValues()).thenReturn(true); @@ -197,7 +197,7 @@ public void testConvertShouldNotTrimNonBreakingSpaceEvenIfSettingsTrimIsTrue() { public void testConvertShouldCorrectlyHandleLeadingEmptyString() { // Given: String data = "/true"; - Class[] parameterTypes = new Class[] { String.class, boolean.class }; + Class[] parameterTypes = new Class[] { String.class, boolean.class }; when(context.getSplitBy()).thenReturn("/"); when(context.isTrimValues()).thenReturn(true); @@ -213,7 +213,7 @@ public void testConvertShouldCorrectlyHandleLeadingEmptyString() { public void testConvertShouldCorrectlyHandleTrailingEmptyString() { // Given: String data = "1 "; - Class[] parameterTypes = new Class[] { int.class, String.class }; + Class[] parameterTypes = new Class[] { int.class, String.class }; when(context.getSplitBy()).thenReturn(" "); when(context.isTrimValues()).thenReturn(true); @@ -229,7 +229,7 @@ public void testConvertShouldCorrectlyHandleTrailingEmptyString() { public void testConvertShouldThrowIllegalArgumentExceptionIfCharHasNotLengthOne() { // Given: String data = "noChar"; - Class[] parameterTypes = new Class[] { char.class }; + Class[] parameterTypes = new Class[] { char.class }; expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("'noChar' cannot be converted to type 'char'"); @@ -244,7 +244,7 @@ public void testConvertShouldThrowIllegalArgumentExceptionIfCharHasNotLengthOne( public void testConvertShouldThrowIllegalArgumentExceptionIfValueOfThrowsNumberFormatException() { // Given: String data = "noInt"; - Class[] parameterTypes = new Class[] { int.class }; + Class[] parameterTypes = new Class[] { int.class }; expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Cannot convert 'noInt' to type 'int'"); @@ -259,7 +259,7 @@ public void testConvertShouldThrowIllegalArgumentExceptionIfValueOfThrowsNumberF public void testConvertShouldThrowIllegalArgumentExceptionForTargetTypeConstructorWithStringArgWhichThrowsException() { // Given: String data = "noInt"; - Class[] parameterTypes = new Class[] { BigInteger.class }; + Class[] parameterTypes = new Class[] { BigInteger.class }; expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage( @@ -275,7 +275,7 @@ public void testConvertShouldThrowIllegalArgumentExceptionForTargetTypeConstruct public void testConvertShouldThrowIllegalArgumentExceptionForUnsupportedTargetType() { // Given: String data = "noObject"; - Class[] parameterTypes = new Class[] { Object.class }; + Class[] parameterTypes = new Class[] { Object.class }; expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage( @@ -291,7 +291,7 @@ public void testConvertShouldThrowIllegalArgumentExceptionForUnsupportedTargetTy public void testConvertShouldCorrectlyParseEnum() { // Given: String data = " VAL1, VAL2 "; - Class[] parameterTypes = new Class[] { TestEnum.class, TestEnum.class }; + Class[] parameterTypes = new Class[] { TestEnum.class, TestEnum.class }; when(context.getSplitBy()).thenReturn(","); when(context.isTrimValues()).thenReturn(true); @@ -307,7 +307,7 @@ public void testConvertShouldCorrectlyParseEnum() { public void testConvertShouldThrowIllegalArgumentExceptionIfEnumValuesIsInvalid() { // Given: String data = "Val1"; - Class[] parameterTypes = new Class[] { TestEnum.class }; + Class[] parameterTypes = new Class[] { TestEnum.class }; expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage( @@ -323,7 +323,7 @@ public void testConvertShouldThrowIllegalArgumentExceptionIfEnumValuesIsInvalid( public void testConvertShouldCorrectlyParseEnumIgnoringCase() { // Given: String data = "Val1,val2"; - Class[] parameterTypes = new Class[] { TestEnum.class, TestEnum.class }; + Class[] parameterTypes = new Class[] { TestEnum.class, TestEnum.class }; when(context.getSplitBy()).thenReturn(","); when(context.isIgnoreEnumCase()).thenReturn(true); @@ -339,7 +339,7 @@ public void testConvertShouldCorrectlyParseEnumIgnoringCase() { public void testConvertShouldThrowIllegalArgumentExceptionIfEnumValueIsInvalid() { // Given: String data = "UNKNOW_ENUM_VALUE"; - Class[] parameterTypes = new Class[] { TestEnum.class }; + Class[] parameterTypes = new Class[] { TestEnum.class }; expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage( @@ -355,7 +355,7 @@ public void testConvertShouldThrowIllegalArgumentExceptionIfEnumValueIsInvalid() public void testConvertShouldCorrectlyParseClass() { // Given: String data = " java.lang.Thread, com.tngtech.junit.dataprovider.DataProviders "; - Class[] parameterTypes = new Class[] { Class.class, Class.class }; + Class[] parameterTypes = new Class[] { Class.class, Class.class }; when(context.getSplitBy()).thenReturn(","); when(context.isTrimValues()).thenReturn(true); @@ -371,7 +371,7 @@ public void testConvertShouldCorrectlyParseClass() { public void testConvertShouldThrowIllegalArgumentExceptionIfClassNameIsInvalid() { // Given: String data = "String"; - Class[] parameterTypes = new Class[] { Class.class }; + Class[] parameterTypes = new Class[] { Class.class }; expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Unable to instantiate 'Class' for 'String'"); @@ -386,7 +386,7 @@ public void testConvertShouldThrowIllegalArgumentExceptionIfClassNameIsInvalid() public void testConvertShouldCorrectlyParseAllPrimitiveWrapperTypes() { // Given: String data = "true,1,c,2,3,4,5.5,6.6"; - Class[] parameterTypes = new Class[] { Boolean.class, Byte.class, Character.class, Short.class, + Class[] parameterTypes = new Class[] { Boolean.class, Byte.class, Character.class, Short.class, Integer.class, Long.class, Float.class, Double.class }; when(context.getSplitBy()).thenReturn(","); @@ -404,7 +404,7 @@ public void testConvertShouldCorrectlyParseAllPrimitiveWrapperTypes() { public void testConvertShouldParseNullValuesAsStringIfSettingsConvertNullsIsFalse() { // Given: String data = "null#null"; - Class[] parameterTypes = new Class[] { String.class, String.class }; + Class[] parameterTypes = new Class[] { String.class, String.class }; when(context.getSplitBy()).thenReturn("#"); @@ -419,7 +419,7 @@ public void testConvertShouldParseNullValuesAsStringIfSettingsConvertNullsIsFals public void testConvertShouldParseNullValuesAsNullObjectIfSettingsConvertNullsIsTrue() { // Given: String data = "null,null,foo"; - Class[] parameterTypes = new Class[] { String.class, String.class, String.class }; + Class[] parameterTypes = new Class[] { String.class, String.class, String.class }; when(context.getSplitBy()).thenReturn(","); when(context.isConvertNulls()).thenReturn(true); diff --git a/core/src/test/java/com/tngtech/junit/dataprovider/resolver/DataProviderResolverContextTest.java b/core/src/test/java/com/tngtech/junit/dataprovider/resolver/DataProviderResolverContextTest.java index bc3e576c..34b54515 100644 --- a/core/src/test/java/com/tngtech/junit/dataprovider/resolver/DataProviderResolverContextTest.java +++ b/core/src/test/java/com/tngtech/junit/dataprovider/resolver/DataProviderResolverContextTest.java @@ -13,7 +13,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import com.tngtech.junit.dataprovider.convert.SingleArgConverter; import com.tngtech.junit.dataprovider.convert.StringConverter; diff --git a/junit-jupiter/src/main/java/com/tngtech/junit/dataprovider/UseDataProviderInvocationContextProvider.java b/junit-jupiter/src/main/java/com/tngtech/junit/dataprovider/UseDataProviderInvocationContextProvider.java index 50044577..10a639e0 100644 --- a/junit-jupiter/src/main/java/com/tngtech/junit/dataprovider/UseDataProviderInvocationContextProvider.java +++ b/junit-jupiter/src/main/java/com/tngtech/junit/dataprovider/UseDataProviderInvocationContextProvider.java @@ -23,7 +23,6 @@ import com.tngtech.junit.dataprovider.convert.ConverterContext; import com.tngtech.junit.dataprovider.convert.DataConverter; -import com.tngtech.junit.dataprovider.format.DataProviderTestNameFormatter; import com.tngtech.junit.dataprovider.resolver.DataProviderResolverContext; /** diff --git a/junit4/src/main/java/com/tngtech/java/junit/dataprovider/DataProviderFrameworkMethod.java b/junit4/src/main/java/com/tngtech/java/junit/dataprovider/DataProviderFrameworkMethod.java index d88e4e22..bc7be7a6 100644 --- a/junit4/src/main/java/com/tngtech/java/junit/dataprovider/DataProviderFrameworkMethod.java +++ b/junit4/src/main/java/com/tngtech/java/junit/dataprovider/DataProviderFrameworkMethod.java @@ -3,6 +3,7 @@ import static com.tngtech.java.junit.dataprovider.common.Preconditions.checkArgument; import static com.tngtech.java.junit.dataprovider.common.Preconditions.checkNotNull; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Arrays; @@ -91,7 +92,8 @@ public String getName() { } try { - return nameFormatter.newInstance().format(getMethod(), idx, Arrays.asList(parameters)); + return nameFormatter.getDeclaredConstructor().newInstance().format(getMethod(), idx, + Arrays.asList(parameters)); } catch (InstantiationException e) { throw new IllegalStateException(String .format("Could not instantiate name formatter using default constructor '%s'.", nameFormatter), @@ -99,6 +101,16 @@ public String getName() { } catch (IllegalAccessException e) { throw new IllegalStateException( String.format("Default constructor not accessable of name formatter '%s'.", nameFormatter), e); + } catch (InvocationTargetException e) { + throw new IllegalStateException(String.format("Default constructor of name formatter '%s' has thrown: %s", + nameFormatter, e.getMessage()), e); + } catch (NoSuchMethodException e) { + throw new IllegalStateException( + String.format("Default constructor not found for name formatter '%s'.", nameFormatter), e); + } catch (Exception e) { + throw new IllegalStateException(String.format( + "Unexpected exception while finding and invoking default constructor of name formatter '%s': %s", + nameFormatter, e.getMessage()), e); } } diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/BaseTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/BaseTest.java index 14a94271..b71751e1 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/BaseTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/BaseTest.java @@ -5,7 +5,6 @@ import java.lang.reflect.Method; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import org.junit.runners.model.FrameworkMethod; @@ -46,11 +45,8 @@ private Method getMethodInt(Class clazz, String methodName) { // -- helper methods to create arrays, lists etc. ------------------------------------------------------------------ - protected List list(T... ts) { - return Arrays.asList(ts); - } - - protected List listOfArrays(T[]... arrays) { + @SafeVarargs + protected final List listOfArrays(T[]... arrays) { List result = new ArrayList(); for (T[] array : arrays) { result.add(array); diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/DataProviderFilterTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/DataProviderFilterTest.java index c6cc1488..88f0af00 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/DataProviderFilterTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/DataProviderFilterTest.java @@ -16,7 +16,7 @@ import org.junit.runner.manipulation.Filter; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/DataProviderFrameworkMethodTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/DataProviderFrameworkMethodTest.java index 4b7ae358..21e6ed62 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/DataProviderFrameworkMethodTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/DataProviderFrameworkMethodTest.java @@ -15,7 +15,7 @@ import org.junit.runner.RunWith; import org.mockito.InOrder; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import com.tngtech.java.junit.dataprovider.internal.placeholder.BasePlaceholder; diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/DataProviderRunnerTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/DataProviderRunnerTest.java index 71042499..37c0d0a1 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/DataProviderRunnerTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/DataProviderRunnerTest.java @@ -42,6 +42,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +@SuppressWarnings({ "unchecked", "deprecation" }) public class DataProviderRunnerTest extends BaseTest { // for testing exceptions in @BeforeClass @@ -172,7 +173,6 @@ public void testValidateInstanceMethodsShouldNotThrowExceptionIfComputeTestMetho doAnswer(new Answer() { @Override - @SuppressWarnings("unchecked") public Void answer(InvocationOnMock invocation) throws Throwable { ((List) invocation.getArguments()[0]).add(new Error()); return null; @@ -252,7 +252,7 @@ public void testValidateTestMethodsShouldAddErrorIfDataProviderMethodNotFoundFor doReturn(asList(testMethod)).when(testClass).getAnnotatedMethods(UseDataProvider.class); doReturn(emptyList()).when(underTest).getDataProviderMethods(testMethod); doReturn(useDataProvider).when(testMethod).getAnnotation(UseDataProvider.class); - doReturn(new Class[] { DefaultDataProviderMethodResolver.class }).when(useDataProvider).resolver(); + doReturn(new Class[] { DefaultDataProviderMethodResolver.class }).when(useDataProvider).resolver(); List errors = new ArrayList(); @@ -274,7 +274,7 @@ public void testValidateTestMethodsShouldAddErrorIfDataProviderMethodNotFoundFor doReturn(asList(testMethod)).when(testClass).getAnnotatedMethods(UseDataProvider.class); doReturn(Collections.emptyList()).when(underTest).getDataProviderMethods(testMethod); doReturn(useDataProvider).when(testMethod).getAnnotation(UseDataProvider.class); - doReturn(new Class[] { null, DefaultDataProviderMethodResolver.class }).when(useDataProvider).resolver(); + doReturn(new Class[] { null, DefaultDataProviderMethodResolver.class }).when(useDataProvider).resolver(); List errors = new ArrayList(); @@ -362,7 +362,8 @@ public void testValidateTestMethodsShouldWorkCorrectlyForMultipleMethodsAnnotate public void testComputeTestMethodsShouldCallGenerateExplodedTestMethodsAndCacheResultIfCalledTheFirstTime() { // Given: underTest.computedTestMethods = null; - doReturn(new ArrayList()).when(underTest).generateExplodedTestMethodsFor(anyListOf(FrameworkMethod.class)); + doReturn(new ArrayList()).when(underTest) + .generateExplodedTestMethodsFor(anyListOf(FrameworkMethod.class)); // When: List result = underTest.computeTestMethods(); @@ -601,7 +602,8 @@ public void testGetDataProviderMethodShouldReturnFirstNotEmptyListIfResolveStrat final List expected3 = Arrays.asList(mock(FrameworkMethod.class)); doReturn(useDataProvider).when(testMethod).getAnnotation(UseDataProvider.class); - doReturn(new Class[] { DataProviderMethodResolver.class, DataProviderMethodResolver.class, DataProviderMethodResolver.class }) + doReturn(new Class[] { DataProviderMethodResolver.class, DataProviderMethodResolver.class, + DataProviderMethodResolver.class }) .when(useDataProvider).resolver(); doReturn(ResolveStrategy.UNTIL_FIRST_MATCH).when(useDataProvider).resolveStrategy(); @@ -629,7 +631,8 @@ public void testGetDataProviderMethodShouldReturnFirstNotEmptyListIfResolveStrat final List expected3 = Arrays.asList(mock(FrameworkMethod.class)); doReturn(useDataProvider).when(testMethod).getAnnotation(UseDataProvider.class); - doReturn(new Class[] { DataProviderMethodResolver.class, DataProviderMethodResolver.class, DataProviderMethodResolver.class }) + doReturn(new Class[] { DataProviderMethodResolver.class, DataProviderMethodResolver.class, + DataProviderMethodResolver.class }) .when(useDataProvider).resolver(); doReturn(ResolveStrategy.AGGREGATE_ALL_MATCHES).when(useDataProvider).resolveStrategy(); diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/DataProvidersTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/DataProvidersTest.java index 1fde89fd..26946680 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/DataProvidersTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/DataProvidersTest.java @@ -2,8 +2,8 @@ import static com.tngtech.java.junit.dataprovider.DataProviders.$; import static com.tngtech.java.junit.dataprovider.DataProviders.$$; -import static com.tngtech.java.junit.dataprovider.DataProviders.testForEach; import static com.tngtech.java.junit.dataprovider.DataProviders.crossProduct; +import static com.tngtech.java.junit.dataprovider.DataProviders.testForEach; import static org.assertj.core.api.Assertions.assertThat; import java.util.ArrayList; @@ -140,7 +140,8 @@ public void testTestForEachIterableShouldThrowNullPointerExceptionForNullArg() { // Given: // When: - testForEach((Iterable) null); + @SuppressWarnings({ "deprecation", "unused" }) + Object[][] result = testForEach((Iterable) null); // Then: expect exception } @@ -153,6 +154,7 @@ public void testTestForEachIterableShouldReturnObjectArrayArrayWithObjectArrayFo set.add(238.78239f); // When: + @SuppressWarnings("deprecation") Object[][] result = testForEach(set); // Then: @@ -167,6 +169,7 @@ public void testTestForEachIterableShouldReturnObjectArrayArrayWithObjectArrayFo list.add(167120l); // When: + @SuppressWarnings("deprecation") Object[][] result = testForEach(list); // Then: diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/DataConverterTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/DataConverterTest.java index 32a0204d..7be566eb 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/DataConverterTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/DataConverterTest.java @@ -1,5 +1,6 @@ package com.tngtech.java.junit.dataprovider.internal; +import static java.util.Arrays.asList; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; @@ -10,6 +11,7 @@ import java.lang.reflect.Type; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Set; @@ -19,7 +21,7 @@ import org.mockito.InOrder; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import com.tngtech.java.junit.dataprovider.BaseTest; import com.tngtech.java.junit.dataprovider.DataProvider; @@ -349,7 +351,7 @@ public void testConvertShouldCallObjectArrayConverterMultipleTimesForObjectArray public void testConvertShouldCallObjectArrayConverterOnlyOnceForListOfListOfObjectWithOneElement() { // Given: @SuppressWarnings("unchecked") - List> data = list(list('a')); + List> data = asList(asList('a')); Class[] parameterTypes = new Class[] { char.class }; // When: @@ -365,7 +367,7 @@ public void testConvertShouldCallObjectArrayConverterOnlyOnceForListOfListOfObje public void testConvertShouldReturnMultipleElementsForListOfListOfObjectWithMultipleElements() { // Given: @SuppressWarnings("unchecked") - List> data = list(this. list('x', "foo"), list('y', "bar"), list('z', "baz")); + List> data = asList(Arrays.asList('x', "foo"), asList('y', "bar"), asList('z', "baz")); Class[] parameterTypes = new Class[] { char.class, String.class }; // When: @@ -416,7 +418,7 @@ public void testConvertShouldCallSingleArgConverterMultipleTimesForObjectArrayWi @Test public void testConvertShouldCallSingleArgConverterOnlyOnceForListOfObjectWithSingleElement() { // Given: - List data = this. list(88); + List data = Arrays.asList(88); Class[] parameterTypes = new Class[] { Object.class }; // When: @@ -432,7 +434,7 @@ public void testConvertShouldCallSingleArgConverterOnlyOnceForListOfObjectWithSi @Test public void testConvertShouldCallSingleArgConverterMultipleTimesForListOfObjectWithMultipleElements() { // Given: - List data = this. list("12", 34L, 5.6); + List data = Arrays.asList("12", 34L, 5.6); Class[] parameterTypes = new Class[] { Object.class }; // When: diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/DefaultDataProviderMethodResolverTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/DefaultDataProviderMethodResolverTest.java index 434b7433..ba9f31f2 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/DefaultDataProviderMethodResolverTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/DefaultDataProviderMethodResolverTest.java @@ -15,7 +15,7 @@ import org.junit.runners.model.TestClass; import org.mockito.Mock; import org.mockito.Spy; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import com.tngtech.java.junit.dataprovider.BaseTest; import com.tngtech.java.junit.dataprovider.DataProvider; @@ -75,9 +75,9 @@ public void testResolveShouldReturnEmptyListForNotFoundDataProviderMethod() { doReturn(testMethodName).when(testMethod).getName(); doReturn(dataProviderMethodName).when(useDataProvider).value(); - doReturn(new Class[0]).when(useDataProvider).location(); + doReturn(new Class[0]).when(useDataProvider).location(); - doReturn(asList(testClass)).when(underTest).findDataProviderLocations(testMethod, new Class[0]); + doReturn(asList(testClass)).when(underTest).findDataProviderLocations(testMethod, new Class[0]); doReturn(emptyList()).when(underTest).findDataProviderMethods(asList(testClass), testMethodName, dataProviderMethodName); // When: @@ -96,9 +96,9 @@ public void testResolveShouldReturnListContainingFoundDataProviderMethods() { doReturn(testMethodName).when(testMethod).getName(); doReturn(dataProviderMethodName).when(useDataProvider).value(); - doReturn(new Class[0]).when(useDataProvider).location(); + doReturn(new Class[0]).when(useDataProvider).location(); - doReturn(asList(testClass)).when(underTest).findDataProviderLocations(testMethod, new Class[0]); + doReturn(asList(testClass)).when(underTest).findDataProviderLocations(testMethod, new Class[0]); doReturn(asList(dataProviderMethod)).when(underTest).findDataProviderMethods(asList(testClass), testMethodName, dataProviderMethodName); @@ -116,7 +116,7 @@ public void testFindDataProviderLocationsShouldReturnTestClassForNotSetLocationI .when(testMethod).getMethod(); // When: - List result = underTest.findDataProviderLocations(testMethod, new Class[0]); + List result = underTest.findDataProviderLocations(testMethod, new Class[0]); // Then: assertThatResultContainsCorrectClassesExactlyInOrder(result, this.getClass()); diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/TestGeneratorTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/TestGeneratorTest.java index d2c2f806..e323dc42 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/TestGeneratorTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/TestGeneratorTest.java @@ -19,7 +19,7 @@ import org.junit.runners.model.FrameworkMethod; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import com.tngtech.java.junit.dataprovider.BaseTest; import com.tngtech.java.junit.dataprovider.DataProvider; diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/TestValidatorTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/TestValidatorTest.java index c3423555..e5b5c10e 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/TestValidatorTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/TestValidatorTest.java @@ -15,7 +15,7 @@ import org.junit.runners.model.FrameworkMethod; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import com.tngtech.java.junit.dataprovider.BaseTest; import com.tngtech.java.junit.dataprovider.DataProvider; diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/convert/AbstractObjectConverterTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/convert/AbstractObjectConverterTest.java index 6f92acf6..e9a6fe50 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/convert/AbstractObjectConverterTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/convert/AbstractObjectConverterTest.java @@ -3,7 +3,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import com.tngtech.java.junit.dataprovider.BaseTest; diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/convert/ObjectArrayConverterTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/convert/ObjectArrayConverterTest.java index 119353fc..528ea3f3 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/convert/ObjectArrayConverterTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/convert/ObjectArrayConverterTest.java @@ -5,7 +5,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import com.tngtech.java.junit.dataprovider.BaseTest; diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/convert/SingleArgConverterTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/convert/SingleArgConverterTest.java index 32b136ff..3d395504 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/convert/SingleArgConverterTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/convert/SingleArgConverterTest.java @@ -5,7 +5,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import com.tngtech.java.junit.dataprovider.BaseTest; diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/convert/StringConverterTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/convert/StringConverterTest.java index 200cce44..d78c7a43 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/convert/StringConverterTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/convert/StringConverterTest.java @@ -18,7 +18,7 @@ import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import com.tngtech.java.junit.dataprovider.BaseTest; import com.tngtech.java.junit.dataprovider.DataProvider; @@ -83,7 +83,7 @@ public void testConvertShouldThrowExceptionIfVarargsAndNumberOfArgumentsIsTwoLes public void testConvertShouldCorrectlyParseAllPrimitiveTypes() { // Given: String data = "true,1,c,2,3,4,5.5,6.6"; - Class[] parameterTypes = new Class[] { boolean.class, byte.class, char.class, short.class, int.class, + Class[] parameterTypes = new Class[] { boolean.class, byte.class, char.class, short.class, int.class, long.class, float.class, double.class }; doReturn(",").when(dataProvider).splitBy(); @@ -99,7 +99,7 @@ public void testConvertShouldCorrectlyParseAllPrimitiveTypes() { public void testConvertShouldCorrectlyParseAllPrimitiveTypesAsJavaString() { // Given: String data = "-5;2014l;-1.234567f;-901e-3"; - Class[] parameterTypes = new Class[] { int.class, long.class, float.class, double.class }; + Class[] parameterTypes = new Class[] { int.class, long.class, float.class, double.class }; doReturn(";").when(dataProvider).splitBy(); @@ -114,7 +114,7 @@ public void testConvertShouldCorrectlyParseAllPrimitiveTypesAsJavaString() { public void testConvertShouldNotTrimValuesIfSettingsTrimIsFalse() { // Given: String data = " foo| bar |baz "; - Class[] parameterTypes = new Class[] { String.class, String.class, String.class }; + Class[] parameterTypes = new Class[] { String.class, String.class, String.class }; doReturn("\\|").when(dataProvider).splitBy(); @@ -129,7 +129,7 @@ public void testConvertShouldNotTrimValuesIfSettingsTrimIsFalse() { public void testConvertShouldTrimAndParseAllPrimitiveTypesIfSettingsTrimIsTrue() { // Given: String data = " false ; 11 ; z ; 22 ; 33 ;44 ; 55.55 ; 66.66 "; - Class[] parameterTypes = new Class[] { boolean.class, byte.class, char.class, short.class, int.class, + Class[] parameterTypes = new Class[] { boolean.class, byte.class, char.class, short.class, int.class, long.class, float.class, double.class }; doReturn(";").when(dataProvider).splitBy(); @@ -146,7 +146,7 @@ public void testConvertShouldTrimAndParseAllPrimitiveTypesIfSettingsTrimIsTrue() public void testConvertShouldTrimNonSpaceWhitespaceCharsIfSettingsTrimIsTrue() { // Given: String data = "\n-1f\n,\r-2\r,\t3.0d\t"; - Class[] parameterTypes = new Class[] { float.class, int.class, double.class }; + Class[] parameterTypes = new Class[] { float.class, int.class, double.class }; doReturn(",").when(dataProvider).splitBy(); doReturn(true).when(dataProvider).trimValues(); @@ -162,7 +162,7 @@ public void testConvertShouldTrimNonSpaceWhitespaceCharsIfSettingsTrimIsTrue() { public void testConvertShouldNotTrimNonBreakingSpaceEvenIfSettingsTrimIsTrue() { // Given: String data = "\u00A0test\u00A0"; - Class[] parameterTypes = new Class[] { String.class }; + Class[] parameterTypes = new Class[] { String.class }; doReturn(true).when(dataProvider).trimValues(); @@ -177,7 +177,7 @@ public void testConvertShouldNotTrimNonBreakingSpaceEvenIfSettingsTrimIsTrue() { public void testConvertShouldCorrectlyHandleLeadingEmptyString() { // Given: String data = "/true"; - Class[] parameterTypes = new Class[] { String.class, boolean.class }; + Class[] parameterTypes = new Class[] { String.class, boolean.class }; doReturn("/").when(dataProvider).splitBy(); doReturn(true).when(dataProvider).trimValues(); @@ -193,7 +193,7 @@ public void testConvertShouldCorrectlyHandleLeadingEmptyString() { public void testConvertShouldCorrectlyHandleTrailingEmptyString() { // Given: String data = "1 "; - Class[] parameterTypes = new Class[] { int.class, String.class }; + Class[] parameterTypes = new Class[] { int.class, String.class }; doReturn(" ").when(dataProvider).splitBy(); doReturn(true).when(dataProvider).trimValues(); @@ -209,7 +209,7 @@ public void testConvertShouldCorrectlyHandleTrailingEmptyString() { public void testConvertShouldThrowIllegalArgumentExceptionIfCharHasNotLengthOne() { // Given: String data = "noChar"; - Class[] parameterTypes = new Class[] { char.class }; + Class[] parameterTypes = new Class[] { char.class }; // When: underTest.convert(data, false, parameterTypes, dataProvider, 40); @@ -221,7 +221,7 @@ public void testConvertShouldThrowIllegalArgumentExceptionIfCharHasNotLengthOne( public void testConvertShouldThrowIllegalArgumentExceptionIfValueOfThrowsNumberFormatException() { // Given: String data = "noInt"; - Class[] parameterTypes = new Class[] { int.class }; + Class[] parameterTypes = new Class[] { int.class }; // When: underTest.convert(data, false, parameterTypes, dataProvider, 41); @@ -233,7 +233,7 @@ public void testConvertShouldThrowIllegalArgumentExceptionIfValueOfThrowsNumberF public void testConvertShouldThrowIllegalArgumentExceptionForTargetTypeConstructorWithStringArgWhichThrowsException() { // Given: String data = "noInt"; - Class[] parameterTypes = new Class[] { BigInteger.class }; + Class[] parameterTypes = new Class[] { BigInteger.class }; // When: underTest.convert(data, false, parameterTypes, dataProvider, 42); @@ -245,7 +245,7 @@ public void testConvertShouldThrowIllegalArgumentExceptionForTargetTypeConstruct public void testConvertShouldThrowIllegalArgumentExceptionForUnsupportedTargetType() { // Given: String data = "noObject"; - Class[] parameterTypes = new Class[] { Object.class }; + Class[] parameterTypes = new Class[] { Object.class }; // When: underTest.convert(data, false, parameterTypes, dataProvider, 43); @@ -257,7 +257,7 @@ public void testConvertShouldThrowIllegalArgumentExceptionForUnsupportedTargetTy public void testConvertShouldCorrectlyParseEnum() { // Given: String data = " VAL1, VAL2 "; - Class[] parameterTypes = new Class[] { TestEnum.class, TestEnum.class }; + Class[] parameterTypes = new Class[] { TestEnum.class, TestEnum.class }; doReturn(",").when(dataProvider).splitBy(); doReturn(true).when(dataProvider).trimValues(); @@ -273,7 +273,7 @@ public void testConvertShouldCorrectlyParseEnum() { public void testConvertShouldThrowIllegalArgumentExceptionIfEnumValuesIsInvalid() { // Given: String data = "Val1"; - Class[] parameterTypes = new Class[] { TestEnum.class }; + Class[] parameterTypes = new Class[] { TestEnum.class }; // When: underTest.convert(data, false, parameterTypes, dataProvider, 51); @@ -285,7 +285,7 @@ public void testConvertShouldThrowIllegalArgumentExceptionIfEnumValuesIsInvalid( public void testConvertShouldCorrectlyParseEnumIgnoringCase() { // Given: String data = "Val1,val2"; - Class[] parameterTypes = new Class[] { TestEnum.class, TestEnum.class }; + Class[] parameterTypes = new Class[] { TestEnum.class, TestEnum.class }; doReturn(",").when(dataProvider).splitBy(); doReturn(true).when(dataProvider).ignoreEnumCase(); @@ -301,7 +301,7 @@ public void testConvertShouldCorrectlyParseEnumIgnoringCase() { public void testConvertShouldThrowIllegalArgumentExceptionIfEnumValueIsInvalid() { // Given: String data = "UNKNOW_ENUM_VALUE"; - Class[] parameterTypes = new Class[] { TestEnum.class }; + Class[] parameterTypes = new Class[] { TestEnum.class }; // When: underTest.convert(data, false, parameterTypes, dataProvider, 51); @@ -313,7 +313,7 @@ public void testConvertShouldThrowIllegalArgumentExceptionIfEnumValueIsInvalid() public void testConvertShouldCorrectlyParseClass() { // Given: String data = " java.lang.Thread, com.tngtech.java.junit.dataprovider.DataProviderRunner "; - Class[] parameterTypes = new Class[] { Class.class, Class.class }; + Class[] parameterTypes = new Class[] { Class.class, Class.class }; doReturn(",").when(dataProvider).splitBy(); doReturn(true).when(dataProvider).trimValues(); @@ -329,7 +329,7 @@ public void testConvertShouldCorrectlyParseClass() { public void testConvertShouldThrowIllegalArgumentExceptionIfClassNameIsInvalid() { // Given: String data = "String"; - Class[] parameterTypes = new Class[] { Class.class }; + Class[] parameterTypes = new Class[] { Class.class }; // When: underTest.convert(data, false, parameterTypes, dataProvider, 55); @@ -341,7 +341,7 @@ public void testConvertShouldThrowIllegalArgumentExceptionIfClassNameIsInvalid() public void testConvertShouldCorrectlyParseAllPrimitiveWrapperTypes() { // Given: String data = "true,1,c,2,3,4,5.5,6.6"; - Class[] parameterTypes = new Class[] { Boolean.class, Byte.class, Character.class, Short.class, + Class[] parameterTypes = new Class[] { Boolean.class, Byte.class, Character.class, Short.class, Integer.class, Long.class, Float.class, Double.class }; doReturn(",").when(dataProvider).splitBy(); @@ -359,7 +359,7 @@ public void testConvertShouldCorrectlyParseAllPrimitiveWrapperTypes() { public void testConvertShouldParseNullValuesAsStringIfSettingsConvertNullsIsFalse() { // Given: String data = "null#null"; - Class[] parameterTypes = new Class[] { String.class, String.class }; + Class[] parameterTypes = new Class[] { String.class, String.class }; doReturn("#").when(dataProvider).splitBy(); @@ -374,7 +374,7 @@ public void testConvertShouldParseNullValuesAsStringIfSettingsConvertNullsIsFals public void testConvertShouldParseNullValuesAsNullObjectIfSettingsConvertNullsIsTrue() { // Given: String data = "null,null,foo"; - Class[] parameterTypes = new Class[] { String.class, String.class, String.class }; + Class[] parameterTypes = new Class[] { String.class, String.class, String.class }; doReturn(",").when(dataProvider).splitBy(); doReturn(true).when(dataProvider).convertNulls(); diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/CanonicalClassNamePlaceholderTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/CanonicalClassNamePlaceholderTest.java index c81da1d1..4f153a3e 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/CanonicalClassNamePlaceholderTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/CanonicalClassNamePlaceholderTest.java @@ -7,7 +7,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import com.tngtech.java.junit.dataprovider.BaseTest; diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/CanonicalMethodNamePlaceholderTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/CanonicalMethodNamePlaceholderTest.java index 65818125..104f2827 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/CanonicalMethodNamePlaceholderTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/CanonicalMethodNamePlaceholderTest.java @@ -7,7 +7,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import com.tngtech.java.junit.dataprovider.BaseTest; diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/IndexPlaceholderTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/IndexPlaceholderTest.java index c8eae103..e9aa0838 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/IndexPlaceholderTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/IndexPlaceholderTest.java @@ -5,7 +5,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import com.tngtech.java.junit.dataprovider.BaseTest; diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/ParameterPlaceholderTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/ParameterPlaceholderTest.java index 135e56bf..dd9964ce 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/ParameterPlaceholderTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/ParameterPlaceholderTest.java @@ -12,7 +12,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import com.tngtech.java.junit.dataprovider.BaseTest; diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/SimpleClassNamePlaceholderTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/SimpleClassNamePlaceholderTest.java index 9a432244..984f750e 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/SimpleClassNamePlaceholderTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/SimpleClassNamePlaceholderTest.java @@ -7,7 +7,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import com.tngtech.java.junit.dataprovider.BaseTest; diff --git a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/SimpleMethodNamePlaceholderTest.java b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/SimpleMethodNamePlaceholderTest.java index 1f85e47f..08ea0f97 100644 --- a/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/SimpleMethodNamePlaceholderTest.java +++ b/junit4/src/test/java/com/tngtech/java/junit/dataprovider/internal/placeholder/SimpleMethodNamePlaceholderTest.java @@ -7,7 +7,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import com.tngtech.java.junit.dataprovider.BaseTest;