@Test public void cancelTest() { NamespaceChangesStatus namespacesChangesStatusReturned = namespacesChangesService.cancel(SERVICE_NAME, namespacedList1); verify(namespacedListsService, never()).addNamespacedList(namespacedList1); Assert.assertEquals(2, namespacesChangesStatusReturned.getNamespaceChanges().size()); }
public NamespaceChangesStatus cancel(String serviceName, NamespacedList namespacedList) { NamespaceChangesStatus namespaceChangesStatus = getNamespaceChangesStatus(serviceName); namespaceChangesStatus.getNamespaceChanges().remove(namespacedList); save(serviceName, namespaceChangesStatus); return namespaceChangesStatus; }
NamespacesChangesService { public NamespaceChangesStatus cancel(String serviceName, NamespacedList namespacedList) { NamespaceChangesStatus namespaceChangesStatus = getNamespaceChangesStatus(serviceName); namespaceChangesStatus.getNamespaceChanges().remove(namespacedList); save(serviceName, namespaceChangesStatus); return namespaceChangesStatus; } }
NamespacesChangesService { public NamespaceChangesStatus cancel(String serviceName, NamespacedList namespacedList) { NamespaceChangesStatus namespaceChangesStatus = getNamespaceChangesStatus(serviceName); namespaceChangesStatus.getNamespaceChanges().remove(namespacedList); save(serviceName, namespaceChangesStatus); return namespaceChangesStatus; }  }
NamespacesChangesService { public NamespaceChangesStatus cancel(String serviceName, NamespacedList namespacedList) { NamespaceChangesStatus namespaceChangesStatus = getNamespaceChangesStatus(serviceName); namespaceChangesStatus.getNamespaceChanges().remove(namespacedList); save(serviceName, namespaceChangesStatus); return namespaceChangesStatus; }  void save(String serviceName, NamespaceChangesStatus namespaceChangesStatus); NamespaceChangesStatus getNamespaceChangesStatus(String serviceName); NamespaceChangesStatus approve(String serviceName, NamespacedList namespacedList); NamespaceChangesStatus cancelAll(String serviceName); NamespaceChangesStatus cancel(String serviceName, NamespacedList namespacedList); NamespaceChangesStatus approveAll(String serviceName); }
NamespacesChangesService { public NamespaceChangesStatus cancel(String serviceName, NamespacedList namespacedList) { NamespaceChangesStatus namespaceChangesStatus = getNamespaceChangesStatus(serviceName); namespaceChangesStatus.getNamespaceChanges().remove(namespacedList); save(serviceName, namespaceChangesStatus); return namespaceChangesStatus; }  void save(String serviceName, NamespaceChangesStatus namespaceChangesStatus); NamespaceChangesStatus getNamespaceChangesStatus(String serviceName); NamespaceChangesStatus approve(String serviceName, NamespacedList namespacedList); NamespaceChangesStatus cancelAll(String serviceName); NamespaceChangesStatus cancel(String serviceName, NamespacedList namespacedList); NamespaceChangesStatus approveAll(String serviceName);  }