Search in sources :

Example 1 with FreeIpaServerResponse

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

the class FreeIpaToFreeIpaServerResponseConverter method convert.

@Override
public FreeIpaServerResponse convert(FreeIpa source) {
    FreeIpaServerResponse response = new FreeIpaServerResponse();
    response.setDomain(source.getDomain());
    response.setHostname(source.getHostname());
    response.setAdminGroupName(source.getAdminGroupName());
    return response;
}
Also used : FreeIpaServerResponse(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.FreeIpaServerResponse)

Example 2 with FreeIpaServerResponse

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

the class StackToDescribeFreeIpaResponseConverterTest method convertTest.

@ParameterizedTest(name = "tunnel={0}")
@EnumSource(Tunnel.class)
@NullSource
void convertTest(Tunnel tunnel) {
    FreeIpaServerResponse freeIpaServerResponse = new FreeIpaServerResponse();
    Stack stack = createStack(tunnel);
    ImageEntity image = new ImageEntity();
    FreeIpa freeIpa = new FreeIpa();
    freeIpa.setDomain(DOMAIN);
    UserSyncStatus userSyncStatus = new UserSyncStatus();
    when(authenticationResponseConverter.convert(stack.getStackAuthentication())).thenReturn(STACK_AUTHENTICATION_RESPONSE);
    when(imageSettingsResponseConverter.convert(image)).thenReturn(IMAGE_SETTINGS_RESPONSE);
    when(freeIpaServerResponseConverter.convert(freeIpa)).thenReturn(freeIpaServerResponse);
    when(instanceGroupConverter.convert(stack.getInstanceGroups(), true)).thenReturn(INSTANCE_GROUP_RESPONSES);
    when(userSyncStatusConverter.convert(userSyncStatus)).thenReturn(USERSYNC_STATUS_RESPONSE);
    when(balancedDnsAvailabilityChecker.isBalancedDnsAvailable(stack)).thenReturn(true);
    when(stackToAvailabilityStatusConverter.convert(stack)).thenReturn(AvailabilityStatus.AVAILABLE);
    DescribeFreeIpaResponse result = underTest.convert(stack, image, freeIpa, Optional.of(userSyncStatus), true);
    assertThat(result).returns(NAME, DescribeFreeIpaResponse::getName).returns(ENV_CRN, DescribeFreeIpaResponse::getEnvironmentCrn).returns(RESOURCE_CRN, DescribeFreeIpaResponse::getCrn).returns(CLOUD_PLATFORM, DescribeFreeIpaResponse::getCloudPlatform).returns(STACK_AUTHENTICATION_RESPONSE, DescribeFreeIpaResponse::getAuthentication).returns(IMAGE_SETTINGS_RESPONSE, DescribeFreeIpaResponse::getImage).returns(freeIpaServerResponse, DescribeFreeIpaResponse::getFreeIpa).returns(INSTANCE_GROUP_RESPONSES, DescribeFreeIpaResponse::getInstanceGroups).returns(STATUS, DescribeFreeIpaResponse::getStatus).returns(STATUS_REASON, DescribeFreeIpaResponse::getStatusReason).returns(STATUS_STRING, DescribeFreeIpaResponse::getStatusString).returns(APP_VERSION, DescribeFreeIpaResponse::getAppVersion).returns(VARIANT, DescribeFreeIpaResponse::getVariant).returns(USERSYNC_STATUS_RESPONSE, DescribeFreeIpaResponse::getUserSyncStatus).returns(tunnel, DescribeFreeIpaResponse::getTunnel);
    assertThat(freeIpaServerResponse).returns(Set.of(SERVER_IP), FreeIpaServerResponse::getServerIp).returns(FREEIPA_HOST, FreeIpaServerResponse::getFreeIpaHost).returns(GATEWAY_PORT, FreeIpaServerResponse::getFreeIpaPort);
}
Also used : DescribeFreeIpaResponse(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.describe.DescribeFreeIpaResponse) FreeIpa(com.sequenceiq.freeipa.entity.FreeIpa) ImageEntity(com.sequenceiq.freeipa.entity.ImageEntity) FreeIpaServerResponse(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.FreeIpaServerResponse) UserSyncStatus(com.sequenceiq.freeipa.entity.UserSyncStatus) Stack(com.sequenceiq.freeipa.entity.Stack) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) NullSource(org.junit.jupiter.params.provider.NullSource)

Aggregations

FreeIpaServerResponse (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.FreeIpaServerResponse)2 DescribeFreeIpaResponse (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.describe.DescribeFreeIpaResponse)1 FreeIpa (com.sequenceiq.freeipa.entity.FreeIpa)1 ImageEntity (com.sequenceiq.freeipa.entity.ImageEntity)1 Stack (com.sequenceiq.freeipa.entity.Stack)1 UserSyncStatus (com.sequenceiq.freeipa.entity.UserSyncStatus)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1 EnumSource (org.junit.jupiter.params.provider.EnumSource)1 NullSource (org.junit.jupiter.params.provider.NullSource)1