Search in sources :

Example 1 with RemoveUser

use of org.apache.rya.api.client.RemoveUser in project incubator-rya by apache.

the class RyaAdminCommandsTest method removeUser.

@Test
public void removeUser() throws Exception {
    // Mock the object that performs the Add User command.
    final RemoveUser mockRemoveUser = mock(RemoveUser.class);
    final RyaClient mockClient = mock(RyaClient.class);
    when(mockClient.getRemoveUser()).thenReturn(java.util.Optional.of(mockRemoveUser));
    final SharedShellState state = new SharedShellState();
    state.connectedToAccumulo(mock(AccumuloConnectionDetails.class), mockClient);
    state.connectedToInstance("test_instance");
    // Execute the command.
    final RyaAdminCommands commands = new RyaAdminCommands(state, mock(InstallPrompt.class), mock(SparqlPrompt.class), mock(UninstallPrompt.class));
    commands.removeUser("alice");
    // Verify the add request was forwarded to the client.
    verify(mockRemoveUser).removeUser(eq("test_instance"), eq("alice"));
}
Also used : RemoveUser(org.apache.rya.api.client.RemoveUser) AccumuloConnectionDetails(org.apache.rya.api.client.accumulo.AccumuloConnectionDetails) SparqlPrompt(org.apache.rya.shell.util.SparqlPrompt) RyaClient(org.apache.rya.api.client.RyaClient) InstallPrompt(org.apache.rya.shell.util.InstallPrompt) UninstallPrompt(org.apache.rya.shell.util.UninstallPrompt) Test(org.junit.Test)

Aggregations

RemoveUser (org.apache.rya.api.client.RemoveUser)1 RyaClient (org.apache.rya.api.client.RyaClient)1 AccumuloConnectionDetails (org.apache.rya.api.client.accumulo.AccumuloConnectionDetails)1 InstallPrompt (org.apache.rya.shell.util.InstallPrompt)1 SparqlPrompt (org.apache.rya.shell.util.SparqlPrompt)1 UninstallPrompt (org.apache.rya.shell.util.UninstallPrompt)1 Test (org.junit.Test)1