Search in sources :

Example 1 with CheckGroupsV1Request

use of com.sequenceiq.freeipa.api.v1.freeipa.test.model.CheckGroupsV1Request in project cloudbreak by hortonworks.

the class FreeIpaFindGroupsAction method action.

public FreeIpaTestDto action(TestContext testContext, FreeIpaTestDto testDto, FreeIpaClient client) throws Exception {
    CheckGroupsV1Request checkGroupsRequest = new CheckGroupsV1Request();
    checkGroupsRequest.setEnvironmentCrn(testDto.getResponse().getEnvironmentCrn());
    checkGroupsRequest.setGroups(groups);
    Log.when(LOGGER, format(" Checking groups [%s] are present at environment '%s'", groups, testDto.getResponse().getEnvironmentCrn()));
    Log.whenJson(LOGGER, format(" FreeIpa '%s' find groups request:%n ", testDto.getResponse().getCrn()), checkGroupsRequest);
    if (!client.getDefaultClient().getClientTestV1Endpoint().checkGroups(checkGroupsRequest).getResult()) {
        throw new TestFailException("Given freeipa groups cannot be found, please check FMS logs for details");
    }
    LOGGER.info(format(" Groups [%s] are present at environment '%s'", groups, testDto.getResponse().getEnvironmentCrn()));
    Log.when(LOGGER, format(" Groups [%s] are present at environment '%s'", groups, testDto.getResponse().getEnvironmentCrn()));
    return testDto;
}
Also used : TestFailException(com.sequenceiq.it.cloudbreak.exception.TestFailException) CheckGroupsV1Request(com.sequenceiq.freeipa.api.v1.freeipa.test.model.CheckGroupsV1Request)

Aggregations

CheckGroupsV1Request (com.sequenceiq.freeipa.api.v1.freeipa.test.model.CheckGroupsV1Request)1 TestFailException (com.sequenceiq.it.cloudbreak.exception.TestFailException)1