Esempio n. 1
0
  @Test
  public void assertGettingNewWorkspaceIsNotRetrievingServerList() throws Exception {
    when(server.execute(isA(MaskedArgumentListBuilder.class))).thenReturn(new StringReader(""));

    Workspaces workspaces = new Workspaces(server);
    workspaces.newWorkspace("name1");
    assertNotNull("The get new workspace returned null", workspaces.getWorkspace("name1"));
    verify(server, times(1)).execute(isA(MaskedArgumentListBuilder.class));
  }
Esempio n. 2
0
  @Test
  public void assertNewWorkspaceIsAddedToMap() throws Exception {
    when(server.execute(isA(MaskedArgumentListBuilder.class))).thenReturn(new StringReader(""));

    Workspaces workspaces = new Workspaces(server);
    Workspace workspace = workspaces.newWorkspace("name1");
    assertNotNull("The new workspace was null", workspace);
    assertTrue("The workspace was reported as non existant", workspaces.exists(workspace));
  }
Esempio n. 3
0
  @Test
  public void assertNewWorkspaceExistsIsNotRetrievingServerList() throws Exception {
    when(server.execute(isA(MaskedArgumentListBuilder.class))).thenReturn(new StringReader(""));

    Workspaces workspaces = new Workspaces(server);
    Workspace workspace = workspaces.newWorkspace("name1");
    assertTrue("The get new workspace did not exists", workspaces.exists(workspace));
    verify(server, times(1)).execute(isA(MaskedArgumentListBuilder.class));
  }
Esempio n. 4
0
 @Test
 public void assertWorkspaceIsDeletedFromMap() throws Exception {
   when(server.execute(isA(MaskedArgumentListBuilder.class))).thenReturn(new StringReader(""));
   Workspaces workspaces = new Workspaces(server);
   // Populate the map in test object
   assertFalse(
       "The workspace was reported as existant", workspaces.exists(new Workspace(server, "name")));
   Workspace workspace = workspaces.newWorkspace("name");
   assertTrue(
       "The workspace was reported as non existant",
       workspaces.exists(new Workspace(server, "name")));
   workspaces.deleteWorkspace(workspace);
   assertFalse("The workspace was reported as existant", workspaces.exists(workspace));
 }