### Question:
SubscriptionResource extends AbstractResource { @DELETE @Path(SUBSCRIPTION_PATH) public void unsubscribe(@PathParam(SUBSCRIPTION_PARAM) String subscriptionId) { checkSystem(); subscriptionId = decodeParameter(subscriptionId); VirtualMachine vm = dao.getVirtualMachine(Integer.valueOf(subscriptionId)); if (vm == null) { throw new VSMException(Status.NOT_FOUND, "There is no subscription with id " + subscriptionId); } vsmService.unsubscribe(vm.getPhysicalMachine().getAddress(), vm.getPhysicalMachine() .getType(), vm.getName()); } SubscriptionResource(); @GET VirtualMachinesDto getSubscriptions(
        @QueryParam(VIRTUAL_MACHINE_NAME_QUERY_PARAM) String virtualMachineName); @POST VirtualMachineDto subscribe(VirtualMachineDto virtualMachine); @DELETE @Path(SUBSCRIPTION_PATH) void unsubscribe(@PathParam(SUBSCRIPTION_PARAM) String subscriptionId); static final String SUBSCRIPTIONS_PATH; static final String SUBSCRIPTION_PARAM; static final String SUBSCRIPTION_PATH; }### Answer:
@Test public void test_unsubscribeUnexisting() { try { subsResource.unsubscribe("15"); fail("Physical machine with id 'vm-unexisting' should not exist"); } catch (VSMException ex) { assertEquals(ex.getResponse().getStatus(), Status.NOT_FOUND.getStatusCode()); } }