Search in sources :

Example 1 with ListFreeIpaResponse

use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.list.ListFreeIpaResponse in project cloudbreak by hortonworks.

the class FreeIpaV1ControllerTest method list.

@Test
void list() {
    List<ListFreeIpaResponse> responseList = Collections.singletonList(new ListFreeIpaResponse());
    when(freeIpaFiltering.filterFreeIpas(AuthorizationResourceAction.DESCRIBE_ENVIRONMENT)).thenReturn(responseList);
    List<ListFreeIpaResponse> actual = underTest.list();
    assertEquals(responseList, actual);
}
Also used : ListFreeIpaResponse(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.list.ListFreeIpaResponse) Test(org.junit.jupiter.api.Test)

Example 2 with ListFreeIpaResponse

use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.list.ListFreeIpaResponse in project cloudbreak by hortonworks.

the class FreeIpaV1ControllerTest method listInternal.

@Test
void listInternal() {
    List<ListFreeIpaResponse> responseList = Collections.singletonList(new ListFreeIpaResponse());
    when(freeIpaListService.list(ACCOUNT_ID)).thenReturn(responseList);
    List<ListFreeIpaResponse> actual = underTest.listInternal(ACCOUNT_ID);
    assertEquals(responseList, actual);
    verify(freeIpaListService).list(ACCOUNT_ID);
}
Also used : ListFreeIpaResponse(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.list.ListFreeIpaResponse) Test(org.junit.jupiter.api.Test)

Example 3 with ListFreeIpaResponse

use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.list.ListFreeIpaResponse in project cloudbreak by hortonworks.

the class FreeIpaToListFreeIpaResponseConverter method convert.

private ListFreeIpaResponse convert(FreeIpa freeIpa) {
    ListFreeIpaResponse response = new ListFreeIpaResponse();
    response.setDomain(freeIpa.getDomain());
    Stack stack = freeIpa.getStack();
    if (stack != null) {
        response.setName(stack.getName());
        response.setCrn(stack.getResourceCrn());
        response.setEnvironmentCrn(stack.getEnvironmentCrn());
        response.setStatus(stack.getStackStatus().getStatus());
        response.setStatusString(stack.getStackStatus().getStatusString());
        response.setAvailabilityStatus(stackToAvailabilityStatusConverter.convert(stack));
    }
    return response;
}
Also used : ListFreeIpaResponse(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.list.ListFreeIpaResponse) Stack(com.sequenceiq.freeipa.entity.Stack)

Aggregations

ListFreeIpaResponse (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.list.ListFreeIpaResponse)3 Test (org.junit.jupiter.api.Test)2 Stack (com.sequenceiq.freeipa.entity.Stack)1