GraphController { @GetMapping(value = "/edge") public DependencyDTO getEdge(@RequestParam("from") String from, @RequestParam("to") String to) { LOGGER.info("Edge: from {} to {}", from, to); Node fromNode = findNode(from); Node toNode = findNode(to); Dependency edge = dependencyGraph.getEdge(fromNode, toNode); if (edge == null) { String message = String.format("No edge from %s to %s", from, to); LOGGER.error(message); throw new NotFoundException(message); } return DependencyMapper.toDTO(edge); }  @Value("${de.qaware.qav.graph.filename}") void setFilename(String filename); @PostConstruct void init(); @GetMapping(value = "/info") GraphInfoDTO getInfo(); @GetMapping(value = "/node") NodeDTO getNode(@RequestParam(value = "name") String name); @GetMapping(value = "/edge") DependencyDTO getEdge(@RequestParam("from") String from,
                                 @RequestParam("to") String to); @GetMapping(value = "/nodes") Page<Node> getNodes(@RequestParam(value = "q", required = false) String query,
                               Pageable pageable);  }
@Test public void testGetEdge() { DependencyDTO edge = graphController.getEdge("v4", "v5"); assertThat(edge, notNullValue()); assertThat(edge.getSourceName(), is("v4")); assertThat(edge.getTargetName(), is("v5")); assertThat(edge.getTypeName(), is("READ_WRITE")); }
@Test(expected = NotFoundException.class) public void testGetEdgeWhenSourceNodeIsWrong() { graphController.getEdge("not-existing-node", "v5"); }
@Test(expected = NotFoundException.class) public void testGetEdgeWhenTargetNodesIsWrong() { graphController.getEdge("v4", "not-existing-node"); }
@Test(expected = NotFoundException.class) public void testGetEdgeWhenNotFound() { graphController.getEdge("v1", "v5"); }