use of com.sequenceiq.freeipa.client.model.Group in project cloudbreak by hortonworks.
the class GroupAddMemberResponse method handleInternal.
@Override
protected Group handleInternal(List<CloudVmMetaDataStatus> metadatas, String body) {
Group group = new Group();
group.setCn("admins");
group.setMemberUser(List.of("admin"));
return group;
}
use of com.sequenceiq.freeipa.client.model.Group in project cloudbreak by hortonworks.
the class GroupFindResponse method handleInternal.
@Override
protected Set<Group> handleInternal(List<CloudVmMetaDataStatus> metadatas, String body) {
Group group = new Group();
group.setCn("admins");
group.setMemberUser(List.of("admin"));
return Set.of(group);
}
use of com.sequenceiq.freeipa.client.model.Group in project cloudbreak by hortonworks.
the class GroupRemoveMemberOperationTest method testInvoke.
@Test
public void testInvoke() throws FreeIpaClientException {
Map warnings = Maps.newHashMap();
RPCResponse<Object> rpcResponse = new RPCResponse<>();
Group group = new Group();
group.setMemberUser(List.of());
rpcResponse.setResult(group);
when(freeIpaClient.invoke(any(), anyList(), any(), any())).thenReturn(rpcResponse);
GroupRemoveMemberOperation.create(GROUP_NAME, USERS, warnings::put).invoke(freeIpaClient);
verify(freeIpaClient).invoke(eq("group_remove_member"), anyList(), any(), any());
assertEquals(0, warnings.size());
}
use of com.sequenceiq.freeipa.client.model.Group in project cloudbreak by hortonworks.
the class GroupRemoveOperationTest method testInvoke.
@Test
public void testInvoke() throws FreeIpaClientException {
Map warnings = Maps.newHashMap();
RPCResponse<Object> rpcResponse = new RPCResponse<>();
rpcResponse.setResult(new Group());
when(freeIpaClient.invoke(any(), anyList(), any(), any())).thenReturn(rpcResponse);
GroupRemoveOperation.create(GROUP_NAME, warnings::put).invoke(freeIpaClient);
verify(freeIpaClient).invoke(eq("group_del"), anyList(), any(), any());
}
use of com.sequenceiq.freeipa.client.model.Group in project cloudbreak by hortonworks.
the class GroupAddOperationTest method testInvokeNonPosix.
@Test
public void testInvokeNonPosix() throws FreeIpaClientException {
Map warnings = Maps.newHashMap();
RPCResponse<Object> rpcResponse = new RPCResponse<>();
rpcResponse.setResult(new Group());
when(freeIpaClient.invoke(any(), anyList(), any(), any())).thenReturn(rpcResponse);
GroupAddOperation.create(GROUP_NAME, NONPOSIX, warnings::put).invoke(freeIpaClient);
ArgumentCaptor<Map<String, Object>> paramCaptor = ArgumentCaptor.forClass(Map.class);
verify(freeIpaClient).invoke(eq("group_add"), anyList(), paramCaptor.capture(), any());
Map<String, Object> params = paramCaptor.getValue();
assertTrue(params.containsKey("nonposix"));
assertTrue((Boolean) params.get("nonposix"));
}
Aggregations