Search in sources :

Example 1 with DescribeCertificatesResult

use of com.amazonaws.services.rds.model.DescribeCertificatesResult in project cloudbreak by hortonworks.

the class AmazonRdsClientTest method describeCertificatesTestSimple.

@Test
void describeCertificatesTestSimple() {
    DescribeCertificatesRequest describeCertificatesRequest = mock(DescribeCertificatesRequest.class);
    DescribeCertificatesResult describeCertificatesResult = mock(DescribeCertificatesResult.class);
    Certificate cert1 = mock(Certificate.class);
    Certificate cert2 = mock(Certificate.class);
    when(describeCertificatesResult.getMarker()).thenReturn(null);
    when(describeCertificatesResult.getCertificates()).thenReturn(List.of(cert1, cert2));
    when(client.describeCertificates(describeCertificatesRequest)).thenReturn(describeCertificatesResult);
    List<Certificate> certificates = underTest.describeCertificates(describeCertificatesRequest);
    assertThat(certificates).isNotNull();
    assertThat(certificates).isEqualTo(List.of(cert1, cert2));
}
Also used : DescribeCertificatesRequest(com.amazonaws.services.rds.model.DescribeCertificatesRequest) DescribeCertificatesResult(com.amazonaws.services.rds.model.DescribeCertificatesResult) Certificate(com.amazonaws.services.rds.model.Certificate) Test(org.junit.jupiter.api.Test)

Example 2 with DescribeCertificatesResult

use of com.amazonaws.services.rds.model.DescribeCertificatesResult in project cloudbreak by hortonworks.

the class AmazonRdsClientTest method describeCertificatesTestWithPaging.

@Test
void describeCertificatesTestWithPaging() {
    DescribeCertificatesRequest describeCertificatesRequest = mock(DescribeCertificatesRequest.class);
    DescribeCertificatesResult describeCertificatesResult1 = mock(DescribeCertificatesResult.class);
    Certificate cert1 = mock(Certificate.class);
    when(describeCertificatesResult1.getMarker()).thenReturn(MARKER);
    when(describeCertificatesResult1.getCertificates()).thenReturn(List.of(cert1));
    DescribeCertificatesResult describeCertificatesResult2 = mock(DescribeCertificatesResult.class);
    Certificate cert2 = mock(Certificate.class);
    when(describeCertificatesResult2.getMarker()).thenReturn(null);
    when(describeCertificatesResult2.getCertificates()).thenReturn(List.of(cert2));
    when(client.describeCertificates(describeCertificatesRequest)).thenReturn(describeCertificatesResult1, describeCertificatesResult2);
    List<Certificate> certificates = underTest.describeCertificates(describeCertificatesRequest);
    assertThat(certificates).isNotNull();
    assertThat(certificates).isEqualTo(List.of(cert1, cert2));
}
Also used : DescribeCertificatesRequest(com.amazonaws.services.rds.model.DescribeCertificatesRequest) DescribeCertificatesResult(com.amazonaws.services.rds.model.DescribeCertificatesResult) Certificate(com.amazonaws.services.rds.model.Certificate) Test(org.junit.jupiter.api.Test)

Aggregations

Certificate (com.amazonaws.services.rds.model.Certificate)2 DescribeCertificatesRequest (com.amazonaws.services.rds.model.DescribeCertificatesRequest)2 DescribeCertificatesResult (com.amazonaws.services.rds.model.DescribeCertificatesResult)2 Test (org.junit.jupiter.api.Test)2