use of org.cloudfoundry.credhub.entity.ValueCredentialVersionData in project credhub by cloudfoundry-incubator.
the class PermissionDataServiceTest method setAccessControlEntries_whenGivenANewAce_returnsTheAcl.
@Test
public void setAccessControlEntries_whenGivenANewAce_returnsTheAcl() {
final ValueCredentialVersionData valueCredentialData2 = new ValueCredentialVersionData("lightsaber2");
final Credential credential2 = valueCredentialData2.getCredential();
credentialDataService.save(credential2);
aces = singletonList(new PermissionEntry(LUKE, singletonList(READ)));
subject.savePermissions(credential2, aces);
List<PermissionEntry> response = subject.getPermissions(credential2);
final PermissionEntry permissionEntry = response.get(0);
assertThat(response, hasSize(1));
assertThat(permissionEntry.getActor(), equalTo(LUKE));
assertThat(permissionEntry.getAllowedOperations(), hasSize(1));
assertThat(permissionEntry.getAllowedOperations(), hasItem(READ));
}
use of org.cloudfoundry.credhub.entity.ValueCredentialVersionData in project credhub by cloudfoundry-incubator.
the class ValueCredentialVersionTest method setValue_whenValueIsNull_throwsException.
@Test(expected = IllegalArgumentException.class)
public void setValue_whenValueIsNull_throwsException() {
valueCredentialData = new ValueCredentialVersionData("foo");
subject = new ValueCredentialVersion(valueCredentialData).setEncryptor(encryptor);
subject.setValue(null);
}
Aggregations