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