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"));
}
Aggregations