Skip to content

Commit

Permalink
adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-fuchs committed Nov 26, 2023
1 parent 8b5a127 commit a842df8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 28 deletions.
8 changes: 1 addition & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,7 @@
<include>**/*Test.java</include>
</includes>
</configuration>
<dependencies>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
</dependency>
</dependencies>

</plugin>

<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

import com.societegenerale.commons.plugin.Log;
import org.apache.commons.io.FileUtils;
import org.mockito.Mock;

import static org.mockito.Mockito.mock;

abstract class AbstractExcludePathTest
{
Expand Down Expand Up @@ -58,8 +59,7 @@ abstract class AbstractExcludePathTest
private static Path tempJavaFileWithFileComment = null;
private static Path tempJavaFileWithDefaultPackage = null;

@Mock
private Log logger;
private final Log logger=mock(Log.class);

static void init() throws IOException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,24 @@
import java.util.HashSet;
import java.util.Set;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;

import static com.societegenerale.commons.plugin.service.ExcludedPathsPreProcessor.PACKAGE_INFO_JAVA;
import static org.assertj.core.api.Assertions.assertThat;


@RunWith (MockitoJUnitRunner.class)
public class ExcludedPathsPreProcessorTest extends AbstractExcludePathTest
{
private final ExcludedPathsPreProcessor preProcessor = new ExcludedPathsPreProcessor();

@BeforeClass
@BeforeAll
public static void init() throws IOException
{
AbstractExcludePathTest.init();
}

@AfterClass
@AfterAll
public static void cleanup() throws IOException
{
AbstractExcludePathTest.cleanup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import java.io.IOException;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;
Expand All @@ -12,13 +12,13 @@ public class JavaFileParserTest extends AbstractExcludePathTest
{
private final JavaFileParser javaFileParser = new JavaFileParser();

@BeforeClass
@BeforeAll
public static void init() throws IOException
{
AbstractExcludePathTest.init();
}

@AfterClass
@AfterAll
public static void cleanup() throws IOException
{
AbstractExcludePathTest.cleanup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
import com.societegenerale.commons.plugin.Log;
import com.societegenerale.commons.plugin.SilentLogWithMemory;
import com.tngtech.archunit.core.importer.Location;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class ExclusionImportOptionTest {

Expand All @@ -24,14 +24,14 @@ public class ExclusionImportOptionTest {

private final Log log = new SilentLogWithMemory();

@BeforeClass
@BeforeAll
public static void init() throws IOException {
testRootDir = Files.createTempDirectory("ExclusionImportOptionTest");
locationToBeExcluded = Location.of(Paths.get(testRootDir.toString(), "com", "societegenerale", "commons", "plugin", "utils", "Foo.class"));
locationToBeIncluded = Location.of(Paths.get(testRootDir.toString(), "com", "societegenerale", "commons", "plugin", "Bar.class"));
}

@AfterClass
@AfterAll
public static void cleanUp() throws IOException {
if (testRootDir != null) {
Files.deleteIfExists(testRootDir);
Expand Down

0 comments on commit a842df8

Please sign in to comment.