Ejemplo n.º 1
0
  @Test
  public void workspaceShouldBeStopped() throws Exception {
    when(event.isDev()).thenReturn(true);
    when(event.getEventType()).thenReturn(DESTROYED);
    when(workspaceManager.getWorkspace(anyString())).thenReturn(workspace);
    when(workspace.getStatus()).thenReturn(WorkspaceStatus.RUNNING);

    listener.onEvent(event);

    verify(workspaceManager).stopWorkspace(anyString());
  }
Ejemplo n.º 2
0
  @Test
  public void workspaceShouldNotBeStoppedWhenItIsNotRunning() throws Exception {
    when(event.isDev()).thenReturn(true);
    when(event.getEventType()).thenReturn(DESTROYED);
    when(workspaceManager.getWorkspace(anyString())).thenReturn(workspace);
    when(workspace.getStatus()).thenReturn(WorkspaceStatus.STOPPED);

    listener.onEvent(event);

    verify(workspaceManager, never()).stopWorkspace(anyString());
  }