@Test(dataProvider = "ValidStartStates") public void testValidStartState(String containerId) throws Throwable { ContainerService.State startState = TestHelper.getContainerServiceStartState(); startState.containerId = containerId; Operation startOperation = testHost.startServiceSynchronously(containerService, startState); assertThat(startOperation.getStatusCode(), is(200)); ContainerService.State savedState = testHost.getServiceState(ContainerService.State.class); assertThat(savedState.containerTemplateServiceLink, is("CONTAINER_TEMPLATE_SERVICE_LINK")); assertThat(savedState.vmServiceLink, is("VM_SERVICE_LINK")); assertThat(savedState.containerId, is(containerId)); }
@Test(dataProvider = "ValidContainerIdPatchValues") public void testValidPatchStateContainerIdFieldSet(String containerId) throws Throwable { createContainerService(); ContainerService.State patchState = new ContainerService.State(); patchState.containerId = containerId; Operation patchOperation = Operation.createPatch(UriUtils.buildUri(testHost, TestHost.SERVICE_URI, null)) .setBody(patchState); Operation patchResult = testHost.sendRequestAndWait(patchOperation); assertThat(patchResult.getStatusCode(), is(200)); ContainerService.State savedState = testHost.getServiceState(ContainerService.State.class); assertThat(savedState.containerId, is(containerId)); }