use of org.cloudfoundry.credhub.service.PermissionService in project credhub by cloudfoundry-incubator.
the class GenerateHandlerTest method setUp.
@Before
public void setUp() throws Exception {
credentialService = mock(PermissionedCredentialService.class);
universalCredentialGenerator = mock(UniversalCredentialGenerator.class);
permissionService = mock(PermissionService.class);
subject = new GenerateHandler(credentialService, permissionService, universalCredentialGenerator);
generationParameters = new StringGenerationParameters();
accessControlEntries = new ArrayList<>();
userContext = new UserContext();
credentialVersion = mock(PasswordCredentialVersion.class);
when(credentialService.save(anyObject(), anyObject(), anyObject(), anyList())).thenReturn(credentialVersion);
}
use of org.cloudfoundry.credhub.service.PermissionService in project credhub by cloudfoundry-incubator.
the class SetHandlerTest method setUp.
@Before
public void setUp() throws Exception {
TestHelper.getBouncyCastleProvider();
credentialService = mock(PermissionedCredentialService.class);
certificateAuthorityService = mock(CertificateAuthorityService.class);
permissionService = mock(PermissionService.class);
userContext = new UserContext();
UserContextHolder userContextHolder = new UserContextHolder();
userContextHolder.setUserContext(userContext);
subject = new SetHandler(credentialService, permissionService, certificateAuthorityService, userContextHolder);
generationParameters = new StringGenerationParameters();
accessControlEntries = new ArrayList<>();
credentialVersion = mock(PasswordCredentialVersion.class);
when(credentialService.save(anyObject(), anyObject(), anyObject(), anyList())).thenReturn(credentialVersion);
}
Aggregations