SPQRNodeManagementResource { @Produces(value = "application/json") @Timed(name = "node-deregistration") @Path("{nodeId}") @DELETE public NodeDeRegistrationResponse deregisterNode(@PathParam("nodeId") final String nodeId) { return this.nodeManager.deregisterNode(nodeId); } SPQRNodeManagementResource(final SPQRNodeManager nodeManager); @Produces(value = "application/json") @Timed(name = "node-registration") @POST NodeRegistrationResponse registerNode(final NodeRegistrationRequest request); @Produces(value = "application/json") @Timed(name = "node-deregistration") @Path("{nodeId}") @DELETE NodeDeRegistrationResponse deregisterNode(@PathParam("nodeId") final String nodeId);  }
@Test public void testDeRegisterNode_withNullInput() { SPQRNodeManager manager = Mockito.mock(SPQRNodeManager.class); Mockito.when(manager.deregisterNode(null)).thenReturn(new NodeDeRegistrationResponse("", NodeDeRegistrationState.MISSING_NODE_ID, "")); Assert.assertEquals("Invalid input", NodeDeRegistrationState.MISSING_NODE_ID, new SPQRNodeManagementResource(manager).deregisterNode(null).getState()); }