@Test public void getNodeSecurity() { when(hudson.getNode("nodeName")).thenReturn(node); assertThat(getInst().getNode("nodeName"), equalTo(node)); Mockito.verify(security).checkPermission(node, Permission.READ); }
public Node getNode(String nodeName) { Node node = findNode(nodeName); if (node == null) { throw new NodeNotFoundException(String.format("Node %s not found.", nodeName)); } return node; }
NodeServiceImpl extends ServiceSupport implements NodeService { public Node getNode(String nodeName) { Node node = findNode(nodeName); if (node == null) { throw new NodeNotFoundException(String.format("Node %s not found.", nodeName)); } return node; } }
NodeServiceImpl extends ServiceSupport implements NodeService { public Node getNode(String nodeName) { Node node = findNode(nodeName); if (node == null) { throw new NodeNotFoundException(String.format("Node %s not found.", nodeName)); } return node; } @Inject  NodeServiceImpl(final SecurityService security); }
NodeServiceImpl extends ServiceSupport implements NodeService { public Node getNode(String nodeName) { Node node = findNode(nodeName); if (node == null) { throw new NodeNotFoundException(String.format("Node %s not found.", nodeName)); } return node; } @Inject  NodeServiceImpl(final SecurityService security); Node getNode(String nodeName); Node findNode(final String nodeName); Node getMasterNode(); List<Node> getAllNodes(); List<Node> getNodes(); Node getCurrentNode(); }
NodeServiceImpl extends ServiceSupport implements NodeService { public Node getNode(String nodeName) { Node node = findNode(nodeName); if (node == null) { throw new NodeNotFoundException(String.format("Node %s not found.", nodeName)); } return node; } @Inject  NodeServiceImpl(final SecurityService security); Node getNode(String nodeName); Node findNode(final String nodeName); Node getMasterNode(); List<Node> getAllNodes(); List<Node> getNodes(); Node getCurrentNode();  }