Skip to content

Commit

Permalink
Revert "introducing scopePaths"
Browse files Browse the repository at this point in the history
This reverts commit 6643d9a.
  • Loading branch information
vincent-fuchs committed Apr 7, 2023
1 parent 6643d9a commit 8f67d23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 31 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.tngtech.archunit.core.domain.JavaClasses;
import org.junit.Test;

import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;

/**
Expand All @@ -26,9 +25,9 @@ public void shouldLoadClassesFromGivenPackage() {
JavaClasses classes = ArchUtils.importAllClassesInPackage(new RootClassFolder("./target/classes/"),
"com/societegenerale/commons/plugin/model");

long noOfClassesInPackage = classes.size();
long noOfClassesInPackage = classes.stream().count();

assertThat(noOfClassesInPackage).isEqualTo(5);
assertThat(noOfClassesInPackage).isEqualTo(4);
}

@Test
Expand All @@ -37,7 +36,7 @@ public void shouldLoadAllClassesWhenGivenPakageDoesntExist() {

long noOfClasses = classes.stream().filter(it -> !it.isNestedClass()).count();

assertThat(noOfClasses).isEqualTo(37);
assertThat(noOfClasses).isEqualTo(36);
}

@Test
Expand All @@ -53,7 +52,7 @@ public void shouldIgnoreClassesFromConfiguredPaths() {
.isNotNull();

JavaClasses classesWithTestClassesExclusions = ArchUtils.importAllClassesInPackage(new RootClassFolder("./target"), "",
singletonList("test-classes"));
Arrays.asList("test-classes"));

assertThat(containsClassWithPattern(classesWithTestClassesExclusions, "ClassToExclude"))
.as("when 'test-classes' pattern configured, ClassToExclude should still be found").isTrue();
Expand All @@ -75,6 +74,7 @@ public void shouldIgnoreClassesFromConfiguredPaths() {

private boolean containsClassWithPattern(JavaClasses javaClassesToTest, String pattern) {

return javaClassesToTest.stream().anyMatch(c -> c.getSource().get().getUri().toString().contains(pattern));
return javaClassesToTest.stream().filter(c -> c.getSource().get().getUri().toString().contains(pattern))
.findFirst().isPresent();
}
}

0 comments on commit 8f67d23

Please sign in to comment.