-
-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
76ebaf4
commit e8ba1f3
Showing
5 changed files
with
119 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...ent/src/test/java/com/structurizr/component/provider/ClassDirectoryTypeProviderTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.structurizr.component.provider; | ||
|
||
import com.structurizr.component.Type; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.File; | ||
import java.util.Set; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
public class ClassDirectoryTypeProviderTests { | ||
|
||
private static final File classes = new File("build/classes/java/test"); | ||
|
||
@Test | ||
void construction_ThrowsAnException_WhenPassedANullDirectory() { | ||
assertThrowsExactly(IllegalArgumentException.class, () -> new ClassDirectoryTypeProvider(null)); | ||
} | ||
|
||
@Test | ||
void construction_ThrowsAnException_WhenPassedAPathThatDoesNotExist() { | ||
assertThrowsExactly(IllegalArgumentException.class, () -> new ClassDirectoryTypeProvider(new File(classes, "com/example"))); | ||
} | ||
|
||
@Test | ||
void construction_ThrowsAnException_WhenPassedAFile() { | ||
assertThrowsExactly(IllegalArgumentException.class, () -> new ClassDirectoryTypeProvider(new File(classes, "com/structurizr/component/provider/ClassDirectoryTypeProviderTests.class"))); | ||
} | ||
|
||
@Test | ||
void getTypes() { | ||
TypeProvider typeProvider = new ClassDirectoryTypeProvider(classes); | ||
Set<Type> types = typeProvider.getTypes(); | ||
|
||
assertTrue(types.size() > 0); | ||
assertNotNull(types.stream().filter(t -> t.getFullyQualifiedName().equals("com.structurizr.component.provider.ClassDirectoryTypeProviderTests"))); | ||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
...nt/src/test/java/com/structurizr/component/provider/SourceDirectoryTypeProviderTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.structurizr.component.provider; | ||
|
||
import com.structurizr.component.Type; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.File; | ||
import java.util.Set; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
public class SourceDirectoryTypeProviderTests { | ||
|
||
private static final File classes = new File("src/main/java"); | ||
|
||
@Test | ||
void construction_ThrowsAnException_WhenPassedANullDirectory() { | ||
assertThrowsExactly(IllegalArgumentException.class, () -> new SourceDirectoryTypeProvider(null)); | ||
} | ||
|
||
@Test | ||
void construction_ThrowsAnException_WhenPassedAPathThatDoesNotExist() { | ||
assertThrowsExactly(IllegalArgumentException.class, () -> new SourceDirectoryTypeProvider(new File(classes, "com/example"))); | ||
} | ||
|
||
@Test | ||
void construction_ThrowsAnException_WhenPassedAFile() { | ||
assertThrowsExactly(IllegalArgumentException.class, () -> new SourceDirectoryTypeProvider(new File(classes, "com/structurizr/component/provider/SourceDirectoryTypeProviderTests.java"))); | ||
} | ||
|
||
@Test | ||
void getTypes() { | ||
TypeProvider typeProvider = new SourceDirectoryTypeProvider(classes); | ||
Set<Type> types = typeProvider.getTypes(); | ||
|
||
assertTrue(types.size() > 0); | ||
assertNotNull(types.stream().filter(t -> t.getFullyQualifiedName().equals("com.structurizr.component.provider.SourceDirectoryTypeProviderTests"))); | ||
} | ||
|
||
} |