@Test(expected = NotFoundException.class) public void testGetEdgeWhenTargetNodesIsWrong() { graphController.getEdge("v4", "not-existing-node"); }
@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); }
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); } }
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); }  }
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); }
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);  }