Skip to content

Commit

Permalink
[MSHARED-1152] - Migrate tests to JUnit5
Browse files Browse the repository at this point in the history
  • Loading branch information
iofit authored Oct 25, 2022
1 parent 24550e3 commit 6c26c63
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 76 deletions.
17 changes: 14 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ under the License.
<project.build.outputTimestamp>2022-04-05T18:45:23Z</project.build.outputTimestamp>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.9.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
Expand All @@ -84,9 +96,8 @@ under the License.
<version>1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
*/

import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
Expand All @@ -30,9 +29,9 @@

import org.apache.maven.shared.utils.Os;
import org.apache.maven.shared.utils.StringUtils;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class DefaultInvokerTest
{
Expand Down Expand Up @@ -121,7 +120,7 @@ public void testSpacePom()
request.setDebug( true );
request.setGoals( Collections.singletonList( "clean" ) );
request.setProperties( getProperties() );

InvocationResult result = invoker.execute( request );

assertEquals( 0, result.getExitCode() );
Expand Down Expand Up @@ -344,7 +343,7 @@ private void logTestStart()

System.out.println( "Starting: " + element.getMethodName() );
}

private Properties getProperties()
{
Properties properties = new Properties();
Expand All @@ -353,7 +352,7 @@ private Properties getProperties()
properties.put( "maven.compiler.source", "1.7" );
properties.put( "maven.compiler.target", "1.7" );
}

String httpProtocols = System.getProperty( "https.protocols" );
if ( httpProtocols != null )
{
Expand Down
Loading

0 comments on commit 6c26c63

Please sign in to comment.