@Test public void testIsServiceAlreadyStarted() { assertFalse(OperationUtil.isServiceAlreadyStarted(null, null)); assertFalse(OperationUtil.isServiceAlreadyStarted(new Exception(), null)); assertFalse(OperationUtil.isServiceAlreadyStarted(new Exception(), new Operation())); assertTrue(OperationUtil .isServiceAlreadyStarted(new ServiceAlreadyStartedException("simulated"), null)); assertTrue(OperationUtil.isServiceAlreadyStarted( new Exception(new ServiceAlreadyStartedException("simulated")), null)); assertTrue(OperationUtil.isServiceAlreadyStarted(null, new Operation().setStatusCode(Operation.STATUS_CODE_CONFLICT))); } }
.setCompletion((o, ex) -> { if (ex != null) { if (OperationUtil.isServiceAlreadyStarted(ex, o)) { logWarning("Container state already exists for container (id=%s)", containerState.id);
.setCompletion((o, e) -> { if (e != null) { if (OperationUtil.isServiceAlreadyStarted(e, o)) { getHost().log(Level.WARNING, "Service %s already started.", allocationTask.documentSelfLink);