use of org.eclipse.che.api.workspace.shared.event.WorkspaceRemovedEvent in project che-server by eclipse-che.
the class RemoveProjectOnWorkspaceRemoveTest method shouldInvokeDeleteIfManagedMethodOnWorkspaceRemovedEvent.
@Test
public void shouldInvokeDeleteIfManagedMethodOnWorkspaceRemovedEvent() throws Exception {
removeProjectOnWorkspaceRemove.onEvent(new WorkspaceRemovedEvent(workspace));
verify(projectFactory).deleteIfManaged(workspace);
}
use of org.eclipse.che.api.workspace.shared.event.WorkspaceRemovedEvent in project che-server by eclipse-che.
the class JpaWorkspaceDao method remove.
@Override
public Optional<WorkspaceImpl> remove(String id) throws ServerException {
requireNonNull(id, "Required non-null id");
Optional<WorkspaceImpl> workspaceOpt;
try {
workspaceOpt = doRemove(id);
workspaceOpt.ifPresent(workspace -> eventService.publish(new WorkspaceRemovedEvent(workspace)));
} catch (RuntimeException x) {
throw new ServerException(x.getLocalizedMessage(), x);
}
return workspaceOpt;
}
use of org.eclipse.che.api.workspace.shared.event.WorkspaceRemovedEvent in project che-server by eclipse-che.
the class RemoveNamespaceOnWorkspaceRemoveTest method shouldRemoveNamespaceIfManagedOnWorkspaceRemovedEventIfNamespaceIsManaged.
@Test
public void shouldRemoveNamespaceIfManagedOnWorkspaceRemovedEventIfNamespaceIsManaged() throws Exception {
removeNamespaceOnWorkspaceRemove.onEvent(new WorkspaceRemovedEvent(workspace));
verify(namespaceFactory).deleteIfManaged(eq(workspace));
}
use of org.eclipse.che.api.workspace.shared.event.WorkspaceRemovedEvent in project devspaces-images by redhat-developer.
the class RemoveProjectOnWorkspaceRemoveTest method shouldInvokeDeleteIfManagedMethodOnWorkspaceRemovedEvent.
@Test
public void shouldInvokeDeleteIfManagedMethodOnWorkspaceRemovedEvent() throws Exception {
removeProjectOnWorkspaceRemove.onEvent(new WorkspaceRemovedEvent(workspace));
verify(projectFactory).deleteIfManaged(workspace);
}
use of org.eclipse.che.api.workspace.shared.event.WorkspaceRemovedEvent in project devspaces-images by redhat-developer.
the class RemoveNamespaceOnWorkspaceRemoveTest method shouldRemoveNamespaceIfManagedOnWorkspaceRemovedEventIfNamespaceIsManaged.
@Test
public void shouldRemoveNamespaceIfManagedOnWorkspaceRemovedEventIfNamespaceIsManaged() throws Exception {
removeNamespaceOnWorkspaceRemove.onEvent(new WorkspaceRemovedEvent(workspace));
verify(namespaceFactory).deleteIfManaged(eq(workspace));
}
Aggregations