@Test public void toDTO() { Node node = dependencyGraph.getNode("v1"); NodeDTO nodeDTO = NodeMapper.toDTO(node, dependencyGraph); assertThat(nodeDTO.getName(), is("v1")); assertThat(nodeDTO.getOutgoingDeps(), hasSize(2)); assertThat(nodeDTO.getOutgoingDeps().get(0).getSourceName(), is("v1")); assertThat(nodeDTO.getOutgoingDeps().get(0).getTargetName(), is("v2")); assertThat(nodeDTO.getOutgoingDeps().get(0).getTypeName(), is("READ_ONLY")); assertThat(nodeDTO.getParents(), hasSize(1)); assertThat(nodeDTO.getParents().get(0).getSourceName(), is("p1")); }
public static NodeDTO toDTO(Node node, DependencyGraph dependencyGraph) { checkNotNull(node, "node"); checkNotNull(dependencyGraph, "dependencyGraph"); NodeDTO result = new NodeDTO(); mapProperties(node, result); mapHierarchy(node, dependencyGraph, result); mapDependencies(result, node, dependencyGraph); return result; }
NodeMapper { public static NodeDTO toDTO(Node node, DependencyGraph dependencyGraph) { checkNotNull(node, "node"); checkNotNull(dependencyGraph, "dependencyGraph"); NodeDTO result = new NodeDTO(); mapProperties(node, result); mapHierarchy(node, dependencyGraph, result); mapDependencies(result, node, dependencyGraph); return result; } }
NodeMapper { public static NodeDTO toDTO(Node node, DependencyGraph dependencyGraph) { checkNotNull(node, "node"); checkNotNull(dependencyGraph, "dependencyGraph"); NodeDTO result = new NodeDTO(); mapProperties(node, result); mapHierarchy(node, dependencyGraph, result); mapDependencies(result, node, dependencyGraph); return result; } private  NodeMapper(); }
NodeMapper { public static NodeDTO toDTO(Node node, DependencyGraph dependencyGraph) { checkNotNull(node, "node"); checkNotNull(dependencyGraph, "dependencyGraph"); NodeDTO result = new NodeDTO(); mapProperties(node, result); mapHierarchy(node, dependencyGraph, result); mapDependencies(result, node, dependencyGraph); return result; } private  NodeMapper(); static NodeDTO toDTO(Node node, DependencyGraph dependencyGraph); }
NodeMapper { public static NodeDTO toDTO(Node node, DependencyGraph dependencyGraph) { checkNotNull(node, "node"); checkNotNull(dependencyGraph, "dependencyGraph"); NodeDTO result = new NodeDTO(); mapProperties(node, result); mapHierarchy(node, dependencyGraph, result); mapDependencies(result, node, dependencyGraph); return result; } private  NodeMapper(); static NodeDTO toDTO(Node node, DependencyGraph dependencyGraph);  }