test: AggregateBdioTransformerTest now tests TRANSITIVE and DIRECT modes
@@ -50,7 +50,7 @@ class AggregateBdioTransformerTest {
}
@Test
- void test() throws DetectUserFriendlyException {
+ void testTransitiveMode() throws DetectUserFriendlyException {
DependencyGraph aggregatedGraph = aggregateBdioTransformer.aggregateCodeLocations(sourceDir, inputCodelocations, AggregateMode.TRANSITIVE);
@@ -65,6 +65,16 @@ class AggregateBdioTransformerTest {
assertTrue(subProjectOneDependencies.contains(genComponentDependency("joda-time", "joda-time", "2.2")));
}
+ @Test
+ void testDirectMode() throws DetectUserFriendlyException {
+
+ DependencyGraph aggregatedGraph = aggregateBdioTransformer.aggregateCodeLocations(sourceDir, inputCodelocations, AggregateMode.DIRECT);
+
+ assertEquals(2, aggregatedGraph.getRootDependencies().size());
+ assertTrue(aggregatedGraph.getRootDependencies().contains(genComponentDependency("junit", "junit", "4.12")));
+ assertTrue(aggregatedGraph.getRootDependencies().contains(genComponentDependency("joda-time", "joda-time", "2.2")));
+ }
+
@NotNull
private static List<DetectCodeLocation> readInputCodeLocations(List<String> inputBdioFilenames, File sourceDir) throws IOException {
File inputBdioDir = new File("src/test/resources/workflow/bdio/aggregation/input");
