Search in sources :

Example 1 with UserSetRequest

use of org.cloudfoundry.credhub.request.UserSetRequest in project credhub by cloudfoundry-incubator.

the class SetHandlerTest method handleSetRequest_whenNonPasswordSetRequest_passesCorrectParametersWithNullGeneration.

@Test
public void handleSetRequest_whenNonPasswordSetRequest_passesCorrectParametersWithNullGeneration() {
    UserSetRequest setRequest = new UserSetRequest();
    final UserCredentialValue userCredentialValue = new UserCredentialValue("Picard", "Enterprise", "salt");
    final ArrayList<EventAuditRecordParameters> eventAuditRecordParameters = new ArrayList<>();
    setRequest.setType("user");
    setRequest.setName("/captain");
    setRequest.setAdditionalPermissions(accessControlEntries);
    setRequest.setOverwrite(false);
    setRequest.setUserValue(userCredentialValue);
    subject.handle(setRequest, eventAuditRecordParameters);
    verify(credentialService).save(null, userCredentialValue, setRequest, eventAuditRecordParameters);
    verify(permissionService).savePermissions(credentialVersion, accessControlEntries, eventAuditRecordParameters, true, "/captain");
}
Also used : UserSetRequest(org.cloudfoundry.credhub.request.UserSetRequest) ArrayList(java.util.ArrayList) UserCredentialValue(org.cloudfoundry.credhub.credential.UserCredentialValue) EventAuditRecordParameters(org.cloudfoundry.credhub.audit.EventAuditRecordParameters) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)1 EventAuditRecordParameters (org.cloudfoundry.credhub.audit.EventAuditRecordParameters)1 UserCredentialValue (org.cloudfoundry.credhub.credential.UserCredentialValue)1 UserSetRequest (org.cloudfoundry.credhub.request.UserSetRequest)1 Test (org.junit.Test)1