diff --git a/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/IntegrationTestMojoTest.java b/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/IntegrationTestMojoTest.java index 63009f12cc..2553369d69 100644 --- a/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/IntegrationTestMojoTest.java +++ b/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/IntegrationTestMojoTest.java @@ -30,7 +30,7 @@ import java.io.IOException; import static org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/MarshallerUnmarshallerTest.java b/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/MarshallerUnmarshallerTest.java index 2e16cbf06b..5df6f7dbcd 100644 --- a/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/MarshallerUnmarshallerTest.java +++ b/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/MarshallerUnmarshallerTest.java @@ -25,7 +25,7 @@ import java.io.File; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * diff --git a/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/RunResultTest.java b/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/RunResultTest.java index e16505a85d..92411b6630 100644 --- a/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/RunResultTest.java +++ b/maven-failsafe-plugin/src/test/java/org/apache/maven/plugin/failsafe/RunResultTest.java @@ -25,7 +25,7 @@ import java.io.File; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * @author Tibor Digana (tibor17) diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoJava7PlusTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoJava7PlusTest.java index c3e144c70d..6c9a7e1c29 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoJava7PlusTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoJava7PlusTest.java @@ -59,8 +59,8 @@ import static java.util.Collections.singleton; import static java.util.Collections.singletonMap; import static org.apache.maven.artifact.versioning.VersionRange.createFromVersion; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Index.atIndex; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.data.Index.atIndex; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.never; diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java index 936666321a..b1afb7f305 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java @@ -96,8 +96,7 @@ import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_RECENT; import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS; import static org.codehaus.plexus.languages.java.jpms.ModuleNameSource.MODULEDESCRIPTOR; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.MapAssert.entry; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; @@ -975,8 +974,8 @@ else if ( "org.junit.platform".equals( artifact.getGroupId() ) assertThat( testClasspathWrapper.getTestDependencies() ) .hasSize( 2 ) - .includes( entry( "junit:junit", testClasspathJUnit ), - entry( "org.hamcrest:hamcrest-core", testClasspathHamcrest ) ); + .containsEntry( "junit:junit", testClasspathJUnit ) + .containsEntry( "org.hamcrest:hamcrest-core", testClasspathHamcrest ); } @Test @@ -1128,14 +1127,14 @@ else if ( "org.junit.platform".equals( resolvable.getGroupId() ) assertThat( testClasspathWrapper.getTestDependencies() ) .hasSize( 8 ) - .includes( entry( "third.party:artifact", testClasspathSomeTestArtifact ), - entry( "org.junit.vintage:junit-vintage-engine", testClasspathVintage ), - entry( "org.apiguardian:apiguardian-api", testClasspathApiguardian ), - entry( "org.junit.platform:junit-platform-engine", testClasspathPlatformEng ), - entry( "junit:junit", testClasspathJUnit4 ), - entry( "org.hamcrest:hamcrest-core", testClasspathHamcrest ), - entry( "org.opentest4j:opentest4j", testClasspathOpentest4j ), - entry( "org.junit.platform:junit-platform-commons", testClasspathCommons ) ); + .containsEntry( "third.party:artifact", testClasspathSomeTestArtifact ) + .containsEntry( "org.junit.vintage:junit-vintage-engine", testClasspathVintage ) + .containsEntry( "org.apiguardian:apiguardian-api", testClasspathApiguardian ) + .containsEntry( "org.junit.platform:junit-platform-engine", testClasspathPlatformEng ) + .containsEntry( "junit:junit", testClasspathJUnit4 ) + .containsEntry( "org.hamcrest:hamcrest-core", testClasspathHamcrest ) + .containsEntry( "org.opentest4j:opentest4j", testClasspathOpentest4j ) + .containsEntry( "org.junit.platform:junit-platform-commons", testClasspathCommons ); } @Test @@ -1257,9 +1256,9 @@ else if ( "org.junit.platform".equals( resolvable.getGroupId() ) assertThat( testClasspathWrapper.getTestDependencies() ) .hasSize( 3 ) - .includes( entry( "third.party:artifact", testClasspathSomeTestArtifact ), - entry( "org.junit.platform:junit-platform-commons", testClasspathCommons ), - entry( "org.apiguardian:apiguardian-api", testClasspathApiguardian ) ); + .containsEntry( "third.party:artifact", testClasspathSomeTestArtifact ) + .containsEntry( "org.junit.platform:junit-platform-commons", testClasspathCommons ) + .containsEntry( "org.apiguardian:apiguardian-api", testClasspathApiguardian ); } @Test @@ -1370,11 +1369,11 @@ else if ( "org.junit.platform".equals( resolvable.getGroupId() ) assertThat( testClasspathWrapper.getTestDependencies() ) .hasSize( 5 ) - .includes( entry( "third.party:artifact", testClasspathSomeTestArtifact ), - entry( "org.junit.platform:junit-platform-engine", testClasspathJUnit5 ), - entry( "org.apiguardian:apiguardian-api", testClasspathApiguardian ), - entry( "org.junit.platform:junit-platform-commons", testClasspathCommons ), - entry( "org.opentest4j:opentest4j", testClasspathOpentest4j ) ); + .containsEntry( "third.party:artifact", testClasspathSomeTestArtifact ) + .containsEntry( "org.junit.platform:junit-platform-engine", testClasspathJUnit5 ) + .containsEntry( "org.apiguardian:apiguardian-api", testClasspathApiguardian ) + .containsEntry( "org.junit.platform:junit-platform-commons", testClasspathCommons ) + .containsEntry( "org.opentest4j:opentest4j", testClasspathOpentest4j ); } @Test @@ -1506,11 +1505,11 @@ else if ( "org.junit.jupiter".equals( resolvable.getGroupId() ) assertThat( testClasspathWrapper.getTestDependencies() ) .hasSize( 5 ) - .includes( entry( "third.party:artifact", testClasspathSomeTestArtifact ), - entry( "org.junit.jupiter:junit-jupiter-api", testClasspathJupiterApi ), - entry( "org.apiguardian:apiguardian-api", testClasspathApiguardian ), - entry( "org.junit.platform:junit-platform-commons", testClasspathCommons ), - entry( "org.opentest4j:opentest4j", testClasspathOpentest4j ) ); + .containsEntry( "third.party:artifact", testClasspathSomeTestArtifact ) + .containsEntry( "org.junit.jupiter:junit-jupiter-api", testClasspathJupiterApi ) + .containsEntry( "org.apiguardian:apiguardian-api", testClasspathApiguardian ) + .containsEntry( "org.junit.platform:junit-platform-commons", testClasspathCommons ) + .containsEntry( "org.opentest4j:opentest4j", testClasspathOpentest4j ); } @Test @@ -1628,13 +1627,13 @@ else if ( "org.junit.platform".equals( resolvable.getGroupId() ) assertThat( testClasspathWrapper.getTestDependencies() ) .hasSize( 7 ) - .includes( entry( "third.party:artifact", testClasspathSomeTestArtifact ), - entry( "org.junit.jupiter:junit-jupiter-engine", testClasspathJupiterEngine ), - entry( "org.junit.platform:junit-platform-engine", testClasspathPlatformEngine ), - entry( "org.junit.jupiter:junit-jupiter-api", testClasspathJupiterApi ), - entry( "org.apiguardian:apiguardian-api", testClasspathApiguardian ), - entry( "org.junit.platform:junit-platform-commons", testClasspathCommons ), - entry( "org.opentest4j:opentest4j", testClasspathOpentest4j ) ); + .containsEntry( "third.party:artifact", testClasspathSomeTestArtifact ) + .containsEntry( "org.junit.jupiter:junit-jupiter-engine", testClasspathJupiterEngine ) + .containsEntry( "org.junit.platform:junit-platform-engine", testClasspathPlatformEngine ) + .containsEntry( "org.junit.jupiter:junit-jupiter-api", testClasspathJupiterApi ) + .containsEntry( "org.apiguardian:apiguardian-api", testClasspathApiguardian ) + .containsEntry( "org.junit.platform:junit-platform-commons", testClasspathCommons ) + .containsEntry( "org.opentest4j:opentest4j", testClasspathOpentest4j ); } @Test @@ -1821,11 +1820,11 @@ else if ( "org.junit.platform".equals( resolvable.getGroupId() ) assertThat( testClasspathWrapper.getTestDependencies() ) .hasSize( 5 ) - .includes( entry( "third.party:artifact", testClasspathSomeTestArtifact ), - entry( "org.junit.jupiter:junit-jupiter-api", testClasspathJupiterApi ), - entry( "org.apiguardian:apiguardian-api", testClasspathApiguardian ), - entry( "org.junit.platform:junit-platform-commons", testClasspathCommons ), - entry( "org.opentest4j:opentest4j", testClasspathOpentest4j ) ); + .containsEntry( "third.party:artifact", testClasspathSomeTestArtifact ) + .containsEntry( "org.junit.jupiter:junit-jupiter-api", testClasspathJupiterApi ) + .containsEntry( "org.apiguardian:apiguardian-api", testClasspathApiguardian ) + .containsEntry( "org.junit.platform:junit-platform-commons", testClasspathCommons ) + .containsEntry( "org.opentest4j:opentest4j", testClasspathOpentest4j ); } @Test @@ -1845,12 +1844,12 @@ public void shouldConvertJunitEngineParameters() throws Exception mojo.setIncludeJUnit5Engines( new String[] {"e1", "e2"} ); invokeMethod( mojo, "convertJunitEngineParameters" ); assertThat( properties ) - .includes( entry( "includejunit5engines", "e1,e2" ) ); + .containsEntry( "includejunit5engines", "e1,e2" ); mojo.setExcludeJUnit5Engines( new String[] {"e1", "e2"} ); invokeMethod( mojo, "convertJunitEngineParameters" ); assertThat( properties ) - .includes( entry( "excludejunit5engines", "e1,e2" ) ); + .containsEntry( "excludejunit5engines", "e1,e2" ); } private static ArtifactResolutionResult createJUnitPlatformLauncherResolutionResult( diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoToolchainsTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoToolchainsTest.java index 8468df588e..4ebe62a6e3 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoToolchainsTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoToolchainsTest.java @@ -26,7 +26,6 @@ import org.apache.maven.toolchain.ToolchainManager; import org.apache.maven.toolchain.java.DefaultJavaToolChain; import org.codehaus.plexus.logging.Logger; -import org.fest.assertions.MapAssert; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -49,7 +48,7 @@ import static java.util.Collections.singletonMap; import static junit.framework.TestCase.assertNull; import static org.apache.maven.surefire.booter.SystemUtils.toJdkHomeFromJre; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.startsWith; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -166,7 +165,7 @@ public void shouldChangeJavaHomeFromToolchain() throws Exception assertThat( mojo.getEnvironmentVariables() ).isEmpty(); JdkAttributes effectiveJvm = invokeMethod( mojo, "getEffectiveJvm" ); - assertThat( mojo.getEnvironmentVariables() ).includes( MapAssert.entry( "JAVA_HOME", "/some/path" ) ); + assertThat( mojo.getEnvironmentVariables() ).containsEntry( "JAVA_HOME", "/some/path" ); assertThat( effectiveJvm.getJvmExecutable().getPath() ) .contains( "/path/from/toolchain".replace( '/', separatorChar ) ); } @@ -183,7 +182,7 @@ public void shouldNotChangeJavaHomeFromToolchainIfAlreadySet() throws Exception mojo.setToolchain( toolchain ); JdkAttributes effectiveJvm = invokeMethod( mojo, "getEffectiveJvm" ); - assertThat( mojo.getEnvironmentVariables() ).includes( MapAssert.entry( "JAVA_HOME", "/already/set/path" ) ); + assertThat( mojo.getEnvironmentVariables() ).containsEntry( "JAVA_HOME", "/already/set/path" ); assertThat( effectiveJvm.getJvmExecutable().getPath() ) .contains( "/path/from/toolchain".replace( '/', separatorChar ) ); } @@ -206,7 +205,7 @@ public void shouldChangeJavaHomeFromJvm() throws Exception assertThat( mojo.getEnvironmentVariables() ).isEmpty(); JdkAttributes effectiveJvm = invokeMethod( mojo, "getEffectiveJvm" ); assertThat( mojo.getEnvironmentVariables() ) - .includes( MapAssert.entry( "JAVA_HOME", currentJdkHome.getAbsolutePath() ) ); + .containsEntry( "JAVA_HOME", currentJdkHome.getAbsolutePath() ); assertThat( effectiveJvm.getJvmExecutable().getPath() ).contains( javaExecutablePath ); } @@ -227,7 +226,7 @@ public void shouldNotChangeJavaHomeFromJvmIfAlreadySet() throws Exception JdkAttributes effectiveJvm = invokeMethod( mojo, "getEffectiveJvm" ); assertThat( mojo.getEnvironmentVariables() ) - .includes( MapAssert.entry( "JAVA_HOME", "/already/set/path" ) ); + .containsEntry( "JAVA_HOME", "/already/set/path" ); assertThat( effectiveJvm.getJvmExecutable().getPath() ).contains( javaExecutablePath ); } diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/CommonReflectorTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/CommonReflectorTest.java index b1f3f79c76..2253dac11e 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/CommonReflectorTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/CommonReflectorTest.java @@ -36,7 +36,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static org.apache.maven.surefire.api.util.ReflectionUtils.getMethod; import static org.apache.maven.surefire.api.util.ReflectionUtils.invokeMethodWithArray; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/MojoMocklessTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/MojoMocklessTest.java index c98cb75650..5db863925a 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/MojoMocklessTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/MojoMocklessTest.java @@ -42,7 +42,7 @@ import static java.util.Arrays.asList; import static java.util.Collections.singletonList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; import static org.powermock.reflect.Whitebox.invokeMethod; import static org.powermock.reflect.Whitebox.setInternalState; diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireDependencyResolverTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireDependencyResolverTest.java index d476dfa331..5593233067 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireDependencyResolverTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireDependencyResolverTest.java @@ -48,7 +48,7 @@ import static java.util.Collections.singletonMap; import static org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec; import static org.apache.maven.plugin.surefire.SurefireDependencyResolver.PROVIDER_GROUP_ID; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireHelperTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireHelperTest.java index f190f033f6..1ecaea7435 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireHelperTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefireHelperTest.java @@ -35,7 +35,7 @@ import static org.apache.maven.plugin.surefire.SurefireHelper.escapeToPlatformPath; import static org.apache.maven.plugin.surefire.SurefireHelper.reportExecution; import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assume.assumeTrue; /** diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfigurationTest.java index 1ed7a1025c..0288db1665 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfigurationTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/DefaultForkConfigurationTest.java @@ -43,7 +43,7 @@ import java.util.Properties; import static java.util.Collections.singleton; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.never; diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkConfigurationTest.java index 9c5e77df41..0784cf93c3 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkConfigurationTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkConfigurationTest.java @@ -32,7 +32,6 @@ import org.apache.maven.surefire.booter.SurefireBooterForkException; import org.apache.maven.surefire.extensions.ForkNodeFactory; import org.apache.maven.surefire.shared.io.FileUtils; -import org.apache.maven.surefire.shared.utils.StringUtils; import org.apache.maven.surefire.shared.utils.cli.Commandline; import org.junit.After; import org.junit.Before; @@ -50,14 +49,15 @@ import java.util.Map; import java.util.Properties; +import static java.lang.String.join; import static java.nio.file.Files.readAllBytes; import static java.util.Collections.singletonList; import static org.apache.maven.surefire.api.util.internal.StringUtils.NL; import static org.apache.maven.surefire.booter.Classpath.emptyClasspath; import static org.apache.maven.surefire.booter.ProcessCheckerType.ALL; import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.util.Files.temporaryFolder; +import static org.assertj.core.api.Assertions.assertThat; +import static org.apache.commons.io.FileUtils.getTempDirectory; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -129,11 +129,11 @@ protected void resolveClasspath( @Nonnull OutputStreamFlushableCommandline cli, ClassLoaderConfiguration clc = new ClassLoaderConfiguration( true, true ); StartupConfiguration startup = new StartupConfiguration( "cls", cpConfig, clc, ALL, providerJpmsArgs ); - Commandline cli = config.createCommandLine( startup, 1, temporaryFolder() ); + Commandline cli = config.createCommandLine( startup, 1, getTempDirectory() ); assertThat( cli.getEnvironmentVariables() ) .contains( "key1=val1", "key2=val2", "key3=val3" ) - .excludes( "PATH=" ) + .doesNotContain( "PATH=" ) .doesNotHaveDuplicates(); } @@ -159,7 +159,7 @@ public void testCliArgs() throws Exception ClassLoaderConfiguration clc = new ClassLoaderConfiguration( true, true ); StartupConfiguration startup = new StartupConfiguration( "cls", cpConfig, clc, ALL, providerJpmsArgs ); - Commandline cli = config.createCommandLine( startup, 1, temporaryFolder() ); + Commandline cli = config.createCommandLine( startup, 1, getTempDirectory() ); String cliAsString = cli.toString(); assertThat( cliAsString ) @@ -236,7 +236,7 @@ protected void resolveClasspath( @Nonnull OutputStreamFlushableCommandline cli, assertThat( startup.isShadefire() ) .isFalse(); - Commandline cli = config.createCommandLine( startup, 1, temporaryFolder() ); + Commandline cli = config.createCommandLine( startup, 1, getTempDirectory() ); assertThat( cli.toString() ) .contains( "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005" ); @@ -257,9 +257,9 @@ public void testCreateCommandLine_UseSystemClassLoaderForkOnce_ShouldConstructMa StartupConfiguration startup = new StartupConfiguration( "", cpConfig, clc, ALL, Collections.emptyList() ); - Commandline cli = config.createCommandLine( startup, 1, temporaryFolder() ); + Commandline cli = config.createCommandLine( startup, 1, getTempDirectory() ); - String line = StringUtils.join( cli.getCommandline(), " " ); + String line = join( " ", cli.getCommandline() ); assertTrue( line.contains( "-jar" ) ); } @@ -278,7 +278,7 @@ public void testArglineWithNewline() StartupConfiguration startup = new StartupConfiguration( "", cpConfig, clc, ALL, Collections.emptyList() ); - Commandline commandLine = config.createCommandLine( startup, 1, temporaryFolder() ); + Commandline commandLine = config.createCommandLine( startup, 1, getTempDirectory() ); assertThat( commandLine.toString() ).contains( IS_OS_WINDOWS ? "abc def" : "'abc' 'def'" ); } @@ -294,7 +294,7 @@ public void testCurrentWorkingDirectoryPropagationIncludingForkNumberExpansion() StartupConfiguration startup = new StartupConfiguration( "", cpConfig, clc, ALL, Collections.emptyList() ); ForkConfiguration config = getForkConfiguration( cwd.getCanonicalFile() ); - Commandline commandLine = config.createCommandLine( startup, 1, temporaryFolder() ); + Commandline commandLine = config.createCommandLine( startup, 1, getTempDirectory() ); File forkDirectory = new File( basedir, "fork_1" ); @@ -312,7 +312,7 @@ public void testExceptionWhenCurrentDirectoryIsNotRealDirectory() try { ForkConfiguration config = getForkConfiguration( cwd.getCanonicalFile() ); - config.createCommandLine( STARTUP_CONFIG, 1, temporaryFolder() ); + config.createCommandLine( STARTUP_CONFIG, 1, getTempDirectory() ); } catch ( SurefireBooterForkException e ) { @@ -341,7 +341,7 @@ public void testExceptionWhenCurrentDirectoryCannotBeCreated() try { ForkConfiguration config = getForkConfiguration( cwd.getAbsoluteFile() ); - config.createCommandLine( STARTUP_CONFIG, 1, temporaryFolder() ); + config.createCommandLine( STARTUP_CONFIG, 1, getTempDirectory() ); } catch ( SurefireBooterForkException sbfe ) { diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkStarterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkStarterTest.java index b7303366e5..3584755107 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkStarterTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkStarterTest.java @@ -63,7 +63,7 @@ import java.util.jar.Manifest; import java.util.zip.Deflater; -import static org.fest.util.Files.delete; +import static org.apache.commons.io.FileUtils.deleteQuietly; import static org.hamcrest.Matchers.containsString; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; @@ -120,7 +120,7 @@ public static void prepareFiles() throws IOException @AfterClass public static void deleteTmp() { - delete( tmp ); + deleteQuietly( tmp ); } @Test diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkingRunListenerTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkingRunListenerTest.java index 68e73c5184..985382517e 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkingRunListenerTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ForkingRunListenerTest.java @@ -59,8 +59,7 @@ import static org.apache.maven.surefire.api.util.internal.Channels.newBufferedChannel; import static org.apache.maven.surefire.api.util.internal.Channels.newChannel; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.MapAssert.entry; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verifyZeroInteractions; @@ -214,10 +213,10 @@ public void testSystemProperties() throws Exception .hasSize( 2 ); assertThat( forkStreamClient.getTestVmSystemProperties() ) - .includes( entry( "k1", "v1" ) ); + .containsEntry( "k1", "v1" ); assertThat( forkStreamClient.getTestVmSystemProperties() ) - .includes( entry( "k2", "v2" ) ); + .containsEntry( "k2", "v2" ); } public void testMultipleEntries() throws Exception diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfigurationTest.java index e44c10ba53..3a1c98bf15 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfigurationTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/JarManifestForkConfigurationTest.java @@ -34,15 +34,15 @@ import static org.apache.maven.plugin.surefire.booterclient.JarManifestForkConfiguration.toAbsoluteUri; import static org.apache.maven.plugin.surefire.booterclient.JarManifestForkConfiguration.toClasspathElementUri; import static org.apache.maven.plugin.surefire.booterclient.JarManifestForkConfiguration.escapeUri; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; -import static org.fest.util.Files.delete; -import static org.fest.util.Files.newTemporaryFolder; +import static org.assertj.core.util.Files.delete; +import static org.assertj.core.util.Files.newTemporaryFolder; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyString; diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java index b1320d5dea..9a40a10689 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfigurationTest.java @@ -46,7 +46,7 @@ import static java.util.Collections.singleton; import static org.apache.maven.surefire.booter.Classpath.emptyClasspath; import static org.apache.maven.surefire.shared.utils.StringUtils.replace; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; /** diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandlineTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandlineTest.java index 3b35cda125..33889245a6 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandlineTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/lazytestprovider/OutputStreamFlushableCommandlineTest.java @@ -20,14 +20,14 @@ */ import org.apache.maven.surefire.shared.utils.cli.CommandLineException; -import org.fest.assertions.Condition; +import org.assertj.core.api.Condition; import org.junit.Test; import java.io.ByteArrayOutputStream; import java.io.IOException; import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.powermock.api.mockito.PowerMockito.mock; diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClientTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClientTest.java index 6cb409db7f..fa360850ad 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClientTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ForkClientTest.java @@ -84,8 +84,7 @@ import static org.apache.maven.surefire.api.booter.ForkedProcessEventType.BOOTERCODE_BYE; import static org.apache.maven.surefire.api.booter.ForkedProcessEventType.BOOTERCODE_CONSOLE_ERROR; import static org.apache.maven.surefire.api.report.RunMode.NORMAL_RUN; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.MapAssert.entry; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.any; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.mock; @@ -888,7 +887,7 @@ public void shouldSendSystemProperty() assertThat( client.getTestVmSystemProperties() ) .hasSize( 1 ); assertThat( client.getTestVmSystemProperties() ) - .includes( entry( "k1", "v1" ) ); + .containsEntry( "k1", "v1" ); } @Test diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumerTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumerTest.java index 3c1fd37948..5b5c3fa08d 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumerTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/booterclient/output/ThreadedStreamConsumerTest.java @@ -32,7 +32,7 @@ import static java.util.concurrent.TimeUnit.SECONDS; import static org.apache.maven.surefire.api.report.RunMode.NORMAL_RUN; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/ConsoleOutputReporterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/ConsoleOutputReporterTest.java index fe92442abf..0fb79da712 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/ConsoleOutputReporterTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/ConsoleOutputReporterTest.java @@ -27,10 +27,9 @@ import org.apache.maven.plugin.surefire.report.DirectConsoleOutput; import org.apache.maven.surefire.extensions.ConsoleOutputReportEventListener; import org.apache.maven.surefire.extensions.ConsoleOutputReporter; -import org.fest.assertions.Assertions; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.powermock.reflect.Whitebox.getInternalState; /** @@ -52,7 +51,7 @@ public void shouldCloneConsoleReporter() .isInstanceOf( SurefireConsoleOutputReporter.class ); assertThat( clone.toString() ) .isEqualTo( "SurefireConsoleOutputReporter{disable=true, encoding=ISO-8859-1}" ); - Assertions.assertThat( ( (SurefireConsoleOutputReporter) clone ).isDisable() ) + assertThat( ( (SurefireConsoleOutputReporter) clone ).isDisable() ) .isTrue(); assertThat( ( (SurefireConsoleOutputReporter) clone ).getEncoding() ) .isEqualTo( "ISO-8859-1" ); diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/E2ETest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/E2ETest.java index 05af3fc4c7..d2a9c20713 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/E2ETest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/E2ETest.java @@ -52,7 +52,7 @@ import static java.util.concurrent.TimeUnit.HOURS; import static java.util.concurrent.TimeUnit.SECONDS; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; /** diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/EventConsumerThreadTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/EventConsumerThreadTest.java index e0bb416d0c..b22f0f823f 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/EventConsumerThreadTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/EventConsumerThreadTest.java @@ -38,7 +38,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.Arrays.copyOfRange; import static java.util.concurrent.TimeUnit.SECONDS; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/ForkedProcessEventNotifierTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/ForkedProcessEventNotifierTest.java index f741cfa472..31bc529dbb 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/ForkedProcessEventNotifierTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/ForkedProcessEventNotifierTest.java @@ -76,7 +76,7 @@ import static org.apache.maven.surefire.api.report.RunMode.NORMAL_RUN; import static org.apache.maven.surefire.api.util.internal.Channels.newBufferedChannel; import static org.apache.maven.surefire.api.util.internal.Channels.newChannel; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertTrue; import static org.junit.rules.ExpectedException.none; import static org.powermock.api.mockito.PowerMockito.mock; diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/StatelessReporterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/StatelessReporterTest.java index 253bbc213d..59fde6bc12 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/StatelessReporterTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/StatelessReporterTest.java @@ -31,7 +31,7 @@ import java.util.HashMap; import java.util.Map; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.powermock.reflect.Whitebox.getInternalState; /** diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/StreamFeederTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/StreamFeederTest.java index 35319e6f6c..696286ccb7 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/StreamFeederTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/StreamFeederTest.java @@ -38,7 +38,7 @@ import static java.util.Arrays.asList; import static org.apache.maven.surefire.api.booter.Command.TEST_SET_FINISHED; import static org.apache.maven.surefire.api.booter.MasterProcessCommand.RUN_CLASS; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java index 35fad194f8..7bdb23540e 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java @@ -44,7 +44,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static org.apache.maven.surefire.api.util.internal.ObjectUtils.systemProps; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/TestSetStatsTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/TestSetStatsTest.java index ebd6b32b28..0d9bd6a484 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/TestSetStatsTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/report/TestSetStatsTest.java @@ -27,7 +27,7 @@ import org.powermock.modules.junit4.PowerMockRunner; import static org.apache.maven.surefire.shared.utils.logging.MessageUtils.buffer; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/runorder/RunEntryStatisticsMapTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/runorder/RunEntryStatisticsMapTest.java index 5f6840a42d..69390d7632 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/runorder/RunEntryStatisticsMapTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/runorder/RunEntryStatisticsMapTest.java @@ -40,7 +40,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static org.apache.maven.surefire.shared.io.IOUtils.readLines; import static org.apache.maven.surefire.api.util.internal.StringUtils.NL; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.powermock.reflect.Whitebox.getInternalState; /** diff --git a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/util/ScannerUtilTest.java b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/util/ScannerUtilTest.java index 066a715319..6c75ecd00f 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/util/ScannerUtilTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/util/ScannerUtilTest.java @@ -21,7 +21,7 @@ import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * Unit test for {@link ScannerUtil} diff --git a/maven-surefire-common/src/test/java/org/apache/maven/surefire/extensions/ForkChannelTest.java b/maven-surefire-common/src/test/java/org/apache/maven/surefire/extensions/ForkChannelTest.java index cd15874d6e..b5dbb63ed8 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/surefire/extensions/ForkChannelTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/surefire/extensions/ForkChannelTest.java @@ -47,7 +47,7 @@ import static java.nio.charset.StandardCharsets.US_ASCII; import static java.util.concurrent.TimeUnit.MILLISECONDS; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/maven-surefire-common/src/test/java/org/apache/maven/surefire/extensions/StatelessTestsetInfoReporterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/surefire/extensions/StatelessTestsetInfoReporterTest.java index 4576a081d8..58d2803e84 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/surefire/extensions/StatelessTestsetInfoReporterTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/surefire/extensions/StatelessTestsetInfoReporterTest.java @@ -41,7 +41,7 @@ import java.util.List; import static java.util.Collections.singletonList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.never; import static org.mockito.Mockito.reset; diff --git a/maven-surefire-common/src/test/java/org/apache/maven/surefire/providerapi/ProviderDetectorTest.java b/maven-surefire-common/src/test/java/org/apache/maven/surefire/providerapi/ProviderDetectorTest.java index 5cc6143f82..161b4c631a 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/surefire/providerapi/ProviderDetectorTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/surefire/providerapi/ProviderDetectorTest.java @@ -33,7 +33,7 @@ import org.mockito.junit.MockitoJUnitRunner; import static java.util.Arrays.asList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; diff --git a/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/ConsoleOutputFileReporterTest.java b/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/ConsoleOutputFileReporterTest.java index 0846af39f6..32877b993d 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/ConsoleOutputFileReporterTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/surefire/report/ConsoleOutputFileReporterTest.java @@ -34,7 +34,7 @@ import org.apache.maven.surefire.shared.utils.io.FileUtils; import static java.nio.charset.StandardCharsets.US_ASCII; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * diff --git a/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/SPITest.java b/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/SPITest.java index 48ee1be7f0..f6affc36cd 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/SPITest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/surefire/spi/SPITest.java @@ -25,7 +25,7 @@ import org.junit.Test; import static java.lang.Thread.currentThread; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * @author Tibor Digana (tibor17) diff --git a/maven-surefire-common/src/test/java/org/apache/maven/surefire/stream/EventDecoderTest.java b/maven-surefire-common/src/test/java/org/apache/maven/surefire/stream/EventDecoderTest.java index c3c15bbb92..9f65264ccf 100644 --- a/maven-surefire-common/src/test/java/org/apache/maven/surefire/stream/EventDecoderTest.java +++ b/maven-surefire-common/src/test/java/org/apache/maven/surefire/stream/EventDecoderTest.java @@ -91,7 +91,7 @@ import static org.apache.maven.surefire.api.stream.SegmentType.END_OF_FRAME; import static org.apache.maven.surefire.api.stream.SegmentType.RUN_MODE; import static org.apache.maven.surefire.api.stream.SegmentType.STRING_ENCODING; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.powermock.api.mockito.PowerMockito.mock; import static org.powermock.api.mockito.PowerMockito.when; import static org.powermock.reflect.Whitebox.invokeMethod; diff --git a/maven-surefire-plugin/src/test/java/org/apache/maven/plugin/surefire/SurefirePluginTest.java b/maven-surefire-plugin/src/test/java/org/apache/maven/plugin/surefire/SurefirePluginTest.java index 72fd630094..5015bc0144 100644 --- a/maven-surefire-plugin/src/test/java/org/apache/maven/plugin/surefire/SurefirePluginTest.java +++ b/maven-surefire-plugin/src/test/java/org/apache/maven/plugin/surefire/SurefirePluginTest.java @@ -27,7 +27,7 @@ import java.io.File; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * diff --git a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireSchemaValidationTest.java b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireSchemaValidationTest.java index c8fe52f31d..2d9f1679c9 100644 --- a/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireSchemaValidationTest.java +++ b/maven-surefire-report-plugin/src/test/java/org/apache/maven/plugins/surefire/report/SurefireSchemaValidationTest.java @@ -30,13 +30,14 @@ import junit.framework.TestCase; import org.apache.maven.shared.utils.io.DirectoryScanner; -import org.fest.assertions.Assertions; import org.junit.Assert; import org.xmlunit.validation.Languages; import org.xmlunit.validation.ValidationProblem; import org.xmlunit.validation.ValidationResult; import org.xmlunit.validation.Validator; +import static org.assertj.core.api.Assertions.assertThat; + /** * */ @@ -59,7 +60,7 @@ public void testValidate_XMLs_against_schema() ds.scan(); String[] xmlFiles = ds.getIncludedFiles(); - Assertions.assertThat( xmlFiles ).describedAs( "No XML surefire reports found to validate" ).isNotEmpty(); + assertThat( xmlFiles ).describedAs( "No XML surefire reports found to validate" ).isNotEmpty(); Validator v = Validator.forLanguage( Languages.W3C_XML_SCHEMA_NS_URI ); v.setSchemaSource( new StreamSource( xsd ) ); diff --git a/pom.xml b/pom.xml index baf5960995..4d85360d76 100644 --- a/pom.xml +++ b/pom.xml @@ -348,16 +348,10 @@ hamcrest-library 1.3 - - org.easytesting - fest-assert - 1.4 - org.assertj assertj-core 3.22.0 - com.google.code.findbugs @@ -395,8 +389,8 @@ test - org.easytesting - fest-assert + org.assertj + assertj-core test diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/api/booter/ForkingRunListenerTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/api/booter/ForkingRunListenerTest.java index 25c479b480..bd5673d36d 100644 --- a/surefire-api/src/test/java/org/apache/maven/surefire/api/booter/ForkingRunListenerTest.java +++ b/surefire-api/src/test/java/org/apache/maven/surefire/api/booter/ForkingRunListenerTest.java @@ -22,7 +22,7 @@ import junit.framework.TestCase; import org.mockito.ArgumentCaptor; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.mock; diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/api/stream/AbstractStreamDecoderTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/api/stream/AbstractStreamDecoderTest.java index c66dbf369e..4c54df3731 100644 --- a/surefire-api/src/test/java/org/apache/maven/surefire/api/stream/AbstractStreamDecoderTest.java +++ b/surefire-api/src/test/java/org/apache/maven/surefire/api/stream/AbstractStreamDecoderTest.java @@ -56,7 +56,7 @@ import static org.apache.maven.surefire.api.booter.Constants.DEFAULT_STREAM_ENCODING; import static org.apache.maven.surefire.api.booter.ForkedProcessEventType.BOOTERCODE_STDOUT; import static org.apache.maven.surefire.api.stream.SegmentType.END_OF_FRAME; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.powermock.reflect.Whitebox.invokeMethod; /** diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/api/stream/AbstractStreamEncoderTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/api/stream/AbstractStreamEncoderTest.java index 116df87235..bec5a58aaf 100644 --- a/surefire-api/src/test/java/org/apache/maven/surefire/api/stream/AbstractStreamEncoderTest.java +++ b/surefire-api/src/test/java/org/apache/maven/surefire/api/stream/AbstractStreamEncoderTest.java @@ -55,7 +55,7 @@ import static org.apache.maven.surefire.api.booter.ForkedProcessEventType.BOOTERCODE_TEST_STARTING; import static org.apache.maven.surefire.api.booter.ForkedProcessEventType.BOOTERCODE_TEST_SUCCEEDED; import static org.apache.maven.surefire.api.report.RunMode.NORMAL_RUN; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/api/util/ReflectionUtilsTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/api/util/ReflectionUtilsTest.java index 0f8c5da936..1c9ea47da0 100644 --- a/surefire-api/src/test/java/org/apache/maven/surefire/api/util/ReflectionUtilsTest.java +++ b/surefire-api/src/test/java/org/apache/maven/surefire/api/util/ReflectionUtilsTest.java @@ -23,7 +23,7 @@ import java.lang.reflect.Constructor; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * Unit test for {@link ReflectionUtils}. diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/AsyncSocketTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/AsyncSocketTest.java index 0ce0d5ef92..dc2b6a2ea9 100644 --- a/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/AsyncSocketTest.java +++ b/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/AsyncSocketTest.java @@ -49,7 +49,7 @@ import static java.net.StandardSocketOptions.TCP_NODELAY; import static org.apache.maven.surefire.api.util.internal.Channels.newInputStream; import static org.apache.maven.surefire.api.util.internal.Channels.newOutputStream; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * Low level Java benchmark test. diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/ChannelsReaderTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/ChannelsReaderTest.java index 9722d8b119..78260d2ab4 100644 --- a/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/ChannelsReaderTest.java +++ b/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/ChannelsReaderTest.java @@ -46,7 +46,7 @@ import java.util.concurrent.Future; import static java.nio.file.Files.write; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.instanceOf; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/ChannelsWriterTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/ChannelsWriterTest.java index 7edb5abc08..21d4877db1 100644 --- a/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/ChannelsWriterTest.java +++ b/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/ChannelsWriterTest.java @@ -44,7 +44,7 @@ import java.util.concurrent.Future; import static java.nio.file.Files.readAllBytes; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.instanceOf; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; diff --git a/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/ObjectUtilsTest.java b/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/ObjectUtilsTest.java index 7d3c0a9753..ef5035ec47 100644 --- a/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/ObjectUtilsTest.java +++ b/surefire-api/src/test/java/org/apache/maven/surefire/api/util/internal/ObjectUtilsTest.java @@ -23,7 +23,7 @@ import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_17; import static org.apache.maven.surefire.shared.lang3.JavaVersion.JAVA_RECENT; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * @since 3.0.0-M6 diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/BooterDeserializerTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/BooterDeserializerTest.java index b1c0284b1f..32cf1545f3 100644 --- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/BooterDeserializerTest.java +++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/BooterDeserializerTest.java @@ -29,7 +29,7 @@ import static org.apache.maven.surefire.booter.BooterConstants.PROVIDER_CONFIGURATION; import static org.apache.maven.surefire.booter.BooterConstants.USESYSTEMCLASSLOADER; import static org.apache.maven.surefire.booter.ProcessCheckerType.ALL; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/CommandReaderTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/CommandReaderTest.java index 2cb7267bf5..0f310c98ab 100644 --- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/CommandReaderTest.java +++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/CommandReaderTest.java @@ -49,7 +49,7 @@ import static java.nio.charset.StandardCharsets.US_ASCII; import static org.apache.maven.surefire.api.util.internal.Channels.newBufferedChannel; import static org.apache.maven.surefire.api.util.internal.Channels.newChannel; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertFalse; @@ -164,11 +164,11 @@ public void twoIterators() throws Exception assertThat( it2.next(), is( getClass().getName() ) ); assertThat( it2.hasNext(), is( true ) ); assertThat( it2.next(), is( A.class.getName() ) ); - assertThat( it2 ).isEmpty(); + assertThat( it2.hasNext() ).isFalse(); assertThat( it1.next(), is( C.class.getName() ) ); addEndOfPipeline(); - assertThat( it1 ).isEmpty(); + assertThat( it1.hasNext() ).isFalse(); } @Test( expected = NoSuchElementException.class ) diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterMockTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterMockTest.java index 37c7b6acfd..62df899301 100644 --- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterMockTest.java +++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterMockTest.java @@ -62,8 +62,8 @@ import static java.nio.charset.StandardCharsets.US_ASCII; import static java.util.concurrent.TimeUnit.SECONDS; import static org.apache.maven.surefire.api.util.internal.Channels.newBufferedChannel; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.assertions.Fail.fail; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; @@ -275,7 +275,7 @@ public void shouldLookupLegacyDecoderFactory() throws Exception public void run() throws Throwable { factory.connect( "tcp://localhost:123" ); - fail(); + fail( "should not connect to the port 123" ); } } ); @@ -386,7 +386,7 @@ public void shouldLookupSurefireDecoderFactory() throws Exception public void run() throws Throwable { factory.connect( "pipe://1" ); - fail(); + fail( "should not connect" ); } } ); @@ -396,7 +396,7 @@ public void run() throws Throwable public void run() throws Throwable { factory.connect( "tcp://localhost:123\u0000\u0000\u0000" ); - fail(); + fail( "should not connect to incorrect uri" ); } } ); diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterTest.java index 2e2dcee324..da3516e797 100644 --- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterTest.java +++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ForkedBooterTest.java @@ -36,7 +36,7 @@ import java.util.concurrent.Semaphore; import static java.nio.charset.StandardCharsets.UTF_8; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.powermock.reflect.Whitebox.invokeMethod; /** diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PpidCheckerTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PpidCheckerTest.java index ce1066b937..5f7a74457b 100644 --- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PpidCheckerTest.java +++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/PpidCheckerTest.java @@ -32,7 +32,7 @@ import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS; import static org.apache.maven.surefire.booter.ProcessInfo.unixProcessInfo; import static org.apache.maven.surefire.booter.ProcessInfo.windowsProcessInfo; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.notNullValue; diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java index 5919dd22e7..6b2ac265fc 100644 --- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java +++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java @@ -38,7 +38,7 @@ import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_LINUX; import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_NET_BSD; import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_OPEN_BSD; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assume.assumeTrue; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/spi/CommandChannelDecoderTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/spi/CommandChannelDecoderTest.java index 648dce0163..fa4b664725 100644 --- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/spi/CommandChannelDecoderTest.java +++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/spi/CommandChannelDecoderTest.java @@ -49,7 +49,7 @@ import static org.apache.maven.surefire.api.booter.Shutdown.DEFAULT; import static org.apache.maven.surefire.api.booter.Shutdown.EXIT; import static org.apache.maven.surefire.api.booter.Shutdown.KILL; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.fail; diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/spi/EventChannelEncoderTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/spi/EventChannelEncoderTest.java index ce36f0e0ac..0828f81629 100644 --- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/spi/EventChannelEncoderTest.java +++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/spi/EventChannelEncoderTest.java @@ -40,7 +40,7 @@ import static org.apache.maven.surefire.api.booter.ForkedProcessEventType.BOOTERCODE_TEST_ERROR; import static org.apache.maven.surefire.api.report.RunMode.NORMAL_RUN; import static org.apache.maven.surefire.api.util.internal.Channels.newBufferedChannel; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/surefire-extensions-api/src/test/java/org/apache/maven/plugin/surefire/extensions/CommandlineExecutorTest.java b/surefire-extensions-api/src/test/java/org/apache/maven/plugin/surefire/extensions/CommandlineExecutorTest.java index 92ee1e3047..e3197befea 100644 --- a/surefire-extensions-api/src/test/java/org/apache/maven/plugin/surefire/extensions/CommandlineExecutorTest.java +++ b/surefire-extensions-api/src/test/java/org/apache/maven/plugin/surefire/extensions/CommandlineExecutorTest.java @@ -33,8 +33,8 @@ import java.nio.file.Paths; import static org.apache.maven.surefire.shared.lang3.SystemUtils.IS_OS_WINDOWS; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.util.Files.delete; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.util.Files.delete; import static org.mockito.ArgumentMatchers.contains; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomObjectFactoryIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomObjectFactoryIT.java index 1cb7f75964..29f77898a8 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomObjectFactoryIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomObjectFactoryIT.java @@ -25,7 +25,7 @@ import java.io.File; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * Test TestNG with custom object factory defined. diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomTestRunnerFactoryIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomTestRunnerFactoryIT.java index f21014e39c..58de8fb9ae 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomTestRunnerFactoryIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgCustomTestRunnerFactoryIT.java @@ -25,7 +25,7 @@ import java.io.File; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * Test TestNG with custom test runner factory defined. diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgExecuteErrorIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgExecuteErrorIT.java index dde0bea7b6..561de477f8 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgExecuteErrorIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/CheckTestNgExecuteErrorIT.java @@ -27,7 +27,7 @@ import java.io.FilenameFilter; import static java.util.Objects.requireNonNull; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47ParallelIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47ParallelIT.java index 9d41b6ceb3..94fa291664 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47ParallelIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnit47ParallelIT.java @@ -26,7 +26,7 @@ import java.util.Iterator; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * Testing JUnitCoreWrapper with ParallelComputerBuilder. diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformEnginesIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformEnginesIT.java index ead5420eb5..fb240f1768 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformEnginesIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformEnginesIT.java @@ -35,8 +35,8 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaVersion; import static org.apache.maven.surefire.its.fixture.IsRegex.regex; -import static org.fest.assertions.Assertions.assertThat; -import static org.fest.util.Collections.set; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.util.Sets.set; import static org.hamcrest.CoreMatchers.allOf; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformStreamCorruptionIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformStreamCorruptionIT.java index 3f4f16ab9d..de502b3bad 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformStreamCorruptionIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/JUnitPlatformStreamCorruptionIT.java @@ -29,7 +29,7 @@ import java.util.List; import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaVersion; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.startsWith; /** diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/LongWindowsPathIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/LongWindowsPathIT.java index 551c18b067..7b4cddd20e 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/LongWindowsPathIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/LongWindowsPathIT.java @@ -28,7 +28,7 @@ import java.io.IOException; import static org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assume.assumeTrue; diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/MultiModuleProjectWithJPMSIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/MultiModuleProjectWithJPMSIT.java index ac563b1af2..30703ba95c 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/MultiModuleProjectWithJPMSIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/MultiModuleProjectWithJPMSIT.java @@ -25,7 +25,7 @@ import java.util.List; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java index e447ab251d..6da995e4ec 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1295AttributeJvmCrashesToTestsIT.java @@ -38,7 +38,7 @@ import static org.apache.maven.surefire.its.jiras.Surefire1295AttributeJvmCrashesToTestsIT.ForkMode.DEFAULT; import static org.apache.maven.surefire.its.jiras.Surefire1295AttributeJvmCrashesToTestsIT.ForkMode.ONE_FORK_NO_REUSE; import static org.apache.maven.surefire.its.jiras.Surefire1295AttributeJvmCrashesToTestsIT.ForkMode.ONE_FORK_REUSE; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; import static org.junit.Assume.assumeTrue; diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1367AssumptionLogsIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1367AssumptionLogsIT.java index ddcf8c81c2..cb57b214f3 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1367AssumptionLogsIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1367AssumptionLogsIT.java @@ -24,7 +24,7 @@ import org.apache.maven.surefire.its.fixture.SurefireLauncher; import org.junit.Test; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * @author Tibor Digana (tibor17) diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire141PluggableProvidersIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire141PluggableProvidersIT.java index cce0000b0b..6f1b748989 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire141PluggableProvidersIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire141PluggableProvidersIT.java @@ -28,7 +28,7 @@ import java.io.File; import java.io.FilenameFilter; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * SUREFIRE-613 Asserts proper test counts when running in parallel diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1535TestNGParallelSuitesIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1535TestNGParallelSuitesIT.java index 9d44fffb53..897c6cb6aa 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1535TestNGParallelSuitesIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire1535TestNGParallelSuitesIT.java @@ -30,7 +30,7 @@ import static org.hamcrest.CoreMatchers.anyOf; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.is; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire34SecurityManagerIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire34SecurityManagerIT.java index fb0e69bba8..267ddfec61 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire34SecurityManagerIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire34SecurityManagerIT.java @@ -27,7 +27,7 @@ import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaMaxVersion; import static org.apache.maven.surefire.its.fixture.HelperAssertions.assumeJavaVersion; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * SUREFIRE-621 Asserts proper test counts when running junit 3 tests in parallel diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire735ForkFailWithRedirectConsoleOutputIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire735ForkFailWithRedirectConsoleOutputIT.java index a8515acab9..6dd0e05973 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire735ForkFailWithRedirectConsoleOutputIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire735ForkFailWithRedirectConsoleOutputIT.java @@ -29,7 +29,7 @@ import java.io.FilenameFilter; import java.util.Collection; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.containsString; /** diff --git a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java index 84d32da37d..f283d995ca 100644 --- a/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java +++ b/surefire-its/src/test/java/org/apache/maven/surefire/its/jiras/Surefire946KillMainProcessInReusableForkIT.java @@ -35,7 +35,7 @@ import java.io.File; import java.util.ArrayList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * diff --git a/surefire-logger-api/src/test/java/org/apache/maven/plugin/surefire/log/api/ConsoleLoggerUtilsTest.java b/surefire-logger-api/src/test/java/org/apache/maven/plugin/surefire/log/api/ConsoleLoggerUtilsTest.java index 902a17eb82..9e819bb595 100644 --- a/surefire-logger-api/src/test/java/org/apache/maven/plugin/surefire/log/api/ConsoleLoggerUtilsTest.java +++ b/surefire-logger-api/src/test/java/org/apache/maven/plugin/surefire/log/api/ConsoleLoggerUtilsTest.java @@ -24,7 +24,7 @@ import java.io.PrintWriter; import java.io.StringWriter; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * Tests for {@link ConsoleLoggerUtils}. diff --git a/surefire-logger-api/src/test/java/org/apache/maven/plugin/surefire/log/api/LevelTest.java b/surefire-logger-api/src/test/java/org/apache/maven/plugin/surefire/log/api/LevelTest.java index 0f488801e6..597a118d9c 100644 --- a/surefire-logger-api/src/test/java/org/apache/maven/plugin/surefire/log/api/LevelTest.java +++ b/surefire-logger-api/src/test/java/org/apache/maven/plugin/surefire/log/api/LevelTest.java @@ -22,7 +22,7 @@ import org.junit.Test; import static org.apache.maven.plugin.surefire.log.api.Level.resolveLevel; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * Tests for {@link Level}. diff --git a/surefire-logger-api/src/test/java/org/apache/maven/plugin/surefire/log/api/LoggersTest.java b/surefire-logger-api/src/test/java/org/apache/maven/plugin/surefire/log/api/LoggersTest.java index 192d209913..2bad634884 100644 --- a/surefire-logger-api/src/test/java/org/apache/maven/plugin/surefire/log/api/LoggersTest.java +++ b/surefire-logger-api/src/test/java/org/apache/maven/plugin/surefire/log/api/LoggersTest.java @@ -25,7 +25,7 @@ import java.io.ByteArrayOutputStream; import java.io.PrintStream; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/surefire-providers/surefire-junit-platform/pom.xml b/surefire-providers/surefire-junit-platform/pom.xml index 9883364aac..264e9a3417 100644 --- a/surefire-providers/surefire-junit-platform/pom.xml +++ b/surefire-providers/surefire-junit-platform/pom.xml @@ -106,11 +106,6 @@ powermock-reflect test - - org.assertj - assertj-core - test - diff --git a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProviderTest.java b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProviderTest.java index 1a00948ca8..f7a9a42ee2 100644 --- a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProviderTest.java +++ b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/JUnitPlatformProviderTest.java @@ -67,7 +67,6 @@ import org.apache.maven.surefire.api.util.RunOrderCalculator; import org.apache.maven.surefire.api.util.ScanResult; import org.apache.maven.surefire.api.util.TestsToRun; -import org.fest.assertions.Assertions; import org.junit.Test; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Disabled; @@ -614,33 +613,33 @@ public void allDiscoveredTestsAreInvokedForNullArgument() ArgumentCaptor report = ArgumentCaptor.forClass( SimpleReportEntry.class ); inOrder.verify( runListener ) .testSetStarting( report.capture() ); - Assertions.assertThat( report.getValue().getSourceName() ) + assertThat( report.getValue().getSourceName() ) .isEqualTo( TestClass1.class.getName() ); - Assertions.assertThat( report.getValue().getName() ) + assertThat( report.getValue().getName() ) .isNull(); report = ArgumentCaptor.forClass( SimpleReportEntry.class ); inOrder.verify( runListener ) .testSetCompleted( report.capture() ); - Assertions.assertThat( report.getValue().getSourceName() ) + assertThat( report.getValue().getSourceName() ) .isEqualTo( TestClass1.class.getName() ); - Assertions.assertThat( report.getValue().getName() ) + assertThat( report.getValue().getName() ) .isNull(); report = ArgumentCaptor.forClass( SimpleReportEntry.class ); inOrder.verify( runListener ) .testSetStarting( report.capture() ); - Assertions.assertThat( report.getValue().getSourceName() ) + assertThat( report.getValue().getSourceName() ) .isEqualTo( TestClass2.class.getName() ); - Assertions.assertThat( report.getValue().getName() ) + assertThat( report.getValue().getName() ) .isNull(); report = ArgumentCaptor.forClass( SimpleReportEntry.class ); inOrder.verify( runListener ) .testSetCompleted( report.capture() ); - Assertions.assertThat( report.getValue().getSourceName() ) + assertThat( report.getValue().getSourceName() ) .isEqualTo( TestClass2.class.getName() ); - Assertions.assertThat( report.getValue().getName() ) + assertThat( report.getValue().getName() ) .isNull(); assertThat( executionListener.summaries ).hasSize( 1 ); diff --git a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java index bf6821429c..d13176d74b 100644 --- a/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java +++ b/surefire-providers/surefire-junit-platform/src/test/java/org/apache/maven/surefire/junitplatform/RunListenerAdapterTest.java @@ -22,7 +22,7 @@ import static java.util.Collections.emptyList; import static java.util.Collections.singleton; import static java.util.Collections.singletonList; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; diff --git a/surefire-providers/surefire-testng/pom.xml b/surefire-providers/surefire-testng/pom.xml index c929b4148a..b638cc87e0 100644 --- a/surefire-providers/surefire-testng/pom.xml +++ b/surefire-providers/surefire-testng/pom.xml @@ -65,11 +65,6 @@ powermock-reflect test - - org.assertj - assertj-core - test - diff --git a/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/TestNGReporterTest.java b/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/TestNGReporterTest.java index 6a07e544b3..8f42b97149 100644 --- a/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/TestNGReporterTest.java +++ b/surefire-providers/surefire-testng/src/test/java/org/apache/maven/surefire/testng/TestNGReporterTest.java @@ -28,7 +28,7 @@ import org.testng.ITestNGMethod; import org.testng.ITestResult; -import static org.fest.assertions.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions;