use of org.eclipse.che.api.workspace.server.event.WorkspaceRemovedEvent in project che by eclipse.
the class WorkspaceSshKeysTest method shouldRemoveSshKeyPairWhenWorkspaceIsRemoved.
/**
* Ensure that when a workspace is removed, any associated ssh keypair is removed on sshManager
*/
@Test
public void shouldRemoveSshKeyPairWhenWorkspaceIsRemoved() throws Exception {
// given
workspaceRemovedEventEventSubscriber.onEvent(new WorkspaceRemovedEvent(this.workspace));
// then
verify(sshManager).removePair(eq(USER_ID), eq("workspace"), eq(WORKSPACE_ID));
}
use of org.eclipse.che.api.workspace.server.event.WorkspaceRemovedEvent in project che by eclipse.
the class JpaWorkspaceDao method remove.
@Override
public void remove(String id) throws ServerException {
requireNonNull(id, "Required non-null id");
try {
Optional<WorkspaceImpl> workspaceOpt = doRemove(id);
workspaceOpt.ifPresent(workspace -> eventService.publish(new WorkspaceRemovedEvent(workspace)));
} catch (RuntimeException x) {
throw new ServerException(x.getLocalizedMessage(), x);
}
}
Aggregations