Search in sources :

Example 1 with SecurityGroupV4StackRequest

use of com.sequenceiq.redbeams.api.endpoint.v4.stacks.SecurityGroupV4StackRequest in project cloudbreak by hortonworks.

the class AllocateDatabaseServerV4RequestToDBStackConverterTest method setUp.

@BeforeEach
public void setUp() {
    ReflectionTestUtils.setField(underTest, FIELD_DB_SERVICE_SUPPORTED_PLATFORMS, Set.of("AWS", "AZURE"));
    ReflectionTestUtils.setField(underTest, FIELD_REDBEAMS_DB_MAJOR_VERSION, REDBEAMS_DB_MAJOR_VERSION);
    ReflectionTestUtils.setField(underTest, FIELD_SSL_ENABLED, true);
    allocateRequest = new AllocateDatabaseServerV4Request();
    networkRequest = new NetworkV4StackRequest();
    allocateRequest.setNetwork(networkRequest);
    databaseServerRequest = new DatabaseServerV4StackRequest();
    allocateRequest.setDatabaseServer(databaseServerRequest);
    securityGroupRequest = new SecurityGroupV4StackRequest();
    databaseServerRequest.setSecurityGroup(securityGroupRequest);
    when(crnUserDetailsService.loadUserByUsername(OWNER_CRN)).thenReturn(getCrnUser());
    when(uuidGeneratorService.randomUuid()).thenReturn("uuid");
    when(accountTagService.list()).thenReturn(new HashMap<>());
    when(uuidGeneratorService.uuidVariableParts(anyInt())).thenReturn("parts");
    when(entitlementService.internalTenant(anyString())).thenReturn(true);
    sslCertificateEntryV2 = new SslCertificateEntry(VERSION_2, CLOUD_PROVIDER_IDENTIFIER_V2, CERT_PEM_V2, x509Certificate);
    sslCertificateEntryV3 = new SslCertificateEntry(VERSION_3, CLOUD_PROVIDER_IDENTIFIER_V3, CERT_PEM_V3, x509Certificate);
    when(databaseServerSslCertificateConfig.getMaxVersionByCloudPlatformAndRegion(anyString(), eq(REGION))).thenReturn(MAX_VERSION);
    when(clock.getCurrentInstant()).thenReturn(NOW);
    when(crnService.createCrn(any(DBStack.class))).thenReturn(CrnTestUtil.getDatabaseServerCrnBuilder().setAccountId("accountid").setResource("1").build());
}
Also used : NetworkV4StackRequest(com.sequenceiq.redbeams.api.endpoint.v4.stacks.NetworkV4StackRequest) DatabaseServerV4StackRequest(com.sequenceiq.redbeams.api.endpoint.v4.stacks.DatabaseServerV4StackRequest) DBStack(com.sequenceiq.redbeams.domain.stack.DBStack) SslCertificateEntry(com.sequenceiq.redbeams.configuration.SslCertificateEntry) AllocateDatabaseServerV4Request(com.sequenceiq.redbeams.api.endpoint.v4.databaseserver.requests.AllocateDatabaseServerV4Request) SecurityGroupV4StackRequest(com.sequenceiq.redbeams.api.endpoint.v4.stacks.SecurityGroupV4StackRequest) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

AllocateDatabaseServerV4Request (com.sequenceiq.redbeams.api.endpoint.v4.databaseserver.requests.AllocateDatabaseServerV4Request)1 DatabaseServerV4StackRequest (com.sequenceiq.redbeams.api.endpoint.v4.stacks.DatabaseServerV4StackRequest)1 NetworkV4StackRequest (com.sequenceiq.redbeams.api.endpoint.v4.stacks.NetworkV4StackRequest)1 SecurityGroupV4StackRequest (com.sequenceiq.redbeams.api.endpoint.v4.stacks.SecurityGroupV4StackRequest)1 SslCertificateEntry (com.sequenceiq.redbeams.configuration.SslCertificateEntry)1 DBStack (com.sequenceiq.redbeams.domain.stack.DBStack)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1