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