BaseRelationTagger { private BaseRelationTagger() { } private  BaseRelationTagger(); static void tagBaseRelationNumbers(DependencyGraph graph);  }
@Test public void testBaseRelationTagger() { DependencyGraph packageGraph = dependencyGraph.filter(new NodePropertyInFilter("architecture", "Package")); assertThat(packageGraph.getAllNodes(), hasSize(9)); Node api = assertNode(packageGraph, "com.company.project.api"); Node comp1 = assertNode(packageGraph, "com.company.project.impl.comp1"); Node comp2 = assertNode(packageGraph, "com.company.project.impl.comp2"); Node util = assertNode(packageGraph, "com.company.project.impl.util"); BaseRelationTagger.tagBaseRelationNumbers(packageGraph); Dependency d1 = assertEdge(packageGraph, comp1, api); assertThat(d1.getProperty(Constants.BASE_REL_COUNT), is(2)); assertThat(d1.getProperty(Constants.BASE_REL_COUNT_SOURCES), is(2L)); assertThat(d1.getProperty(Constants.BASE_REL_COUNT_TARGETS), is(2L)); Dependency d2 = assertEdge(packageGraph, comp2, util); assertThat(d2.getProperty(Constants.BASE_REL_COUNT), is(3)); assertThat(d2.getProperty(Constants.BASE_REL_COUNT_SOURCES), is(2L)); assertThat(d2.getProperty(Constants.BASE_REL_COUNT_TARGETS), is(3L)); Node com = assertNode(packageGraph, "com"); Node company = assertNode(packageGraph, "com.company"); Dependency d3 = assertEdge(packageGraph, com, company); assertThat(d3.hasProperty(Constants.BASE_REL_COUNT), is(false)); }