use of com.nike.cerberus.domain.AuthKmsKeyMetadataResult in project cerberus by Nike-Inc.
the class AdminActionsControllerTest method testGetAuthKmsKeyMetadataWhenKmsServiceReturnsEmptyMetadata.
@Test
public void testGetAuthKmsKeyMetadataWhenKmsServiceReturnsEmptyMetadata() {
AuthKmsKeyMetadataResult authKmsKeyMetadata = adminActionsController.getAuthKmsKeyMetadata();
Assert.assertNotNull(authKmsKeyMetadata);
Assert.assertEquals(0, authKmsKeyMetadata.getAuthenticationKmsKeyMetadata().size());
}
use of com.nike.cerberus.domain.AuthKmsKeyMetadataResult in project cerberus by Nike-Inc.
the class AdminActionsControllerTest method testGetAuthKmsKeyMetadataWhenKmsServiceReturnsListWithAuthenticationKmsData.
@Test
public void testGetAuthKmsKeyMetadataWhenKmsServiceReturnsListWithAuthenticationKmsData() {
AuthKmsKeyMetadata authKmsKeyMetadata = new AuthKmsKeyMetadata();
List<AuthKmsKeyMetadata> authKmsKeyMetadataList = new ArrayList<>();
authKmsKeyMetadataList.add(authKmsKeyMetadata);
Mockito.when(kmsService.getAuthenticationKmsMetadata()).thenReturn(authKmsKeyMetadataList);
AuthKmsKeyMetadataResult authKmsKeyMetadataResult = adminActionsController.getAuthKmsKeyMetadata();
Assert.assertNotNull(authKmsKeyMetadataResult);
Assert.assertSame(authKmsKeyMetadataList, authKmsKeyMetadataResult.getAuthenticationKmsKeyMetadata());
Assert.assertSame(authKmsKeyMetadata, authKmsKeyMetadataResult.getAuthenticationKmsKeyMetadata().get(0));
}
use of com.nike.cerberus.domain.AuthKmsKeyMetadataResult in project cerberus by Nike-Inc.
the class AdminActionsControllerTest method testGetAuthKmsKeyMetadataWhenKmsServiceReturnsNull.
@Test
public void testGetAuthKmsKeyMetadataWhenKmsServiceReturnsNull() {
Mockito.when(kmsService.getAuthenticationKmsMetadata()).thenReturn(null);
AuthKmsKeyMetadataResult authKmsKeyMetadata = adminActionsController.getAuthKmsKeyMetadata();
Assert.assertNotNull(authKmsKeyMetadata);
Assert.assertNull(authKmsKeyMetadata.getAuthenticationKmsKeyMetadata());
}
Aggregations