use of io.dropwizard.jersey.params.LongParam in project keywhiz by square.
the class MembershipResourceTest method missingGroupAllow.
@Test(expected = NotFoundException.class)
public void missingGroupAllow() {
doThrow(IllegalStateException.class).when(aclDAO).findAndAllowAccess(secret.getId(), 98, auditLog, "user", new HashMap<>());
resource.allowAccess(user, new LongParam(Long.toString(secret.getId())), new LongParam("98"));
}
use of io.dropwizard.jersey.params.LongParam in project keywhiz by square.
the class MembershipResourceTest method missingGroupDisallow.
@Test(expected = NotFoundException.class)
public void missingGroupDisallow() {
doThrow(IllegalStateException.class).when(aclDAO).findAndRevokeAccess(secret.getId(), 3543, auditLog, "user", new HashMap<>());
resource.disallowAccess(user, new LongParam(Long.toString(secret.getId())), new LongParam("3543"));
}
use of io.dropwizard.jersey.params.LongParam in project keywhiz by square.
the class MembershipResourceTest method evictThrowsWhenGroupIdNotFound.
@Test(expected = NotFoundException.class)
public void evictThrowsWhenGroupIdNotFound() {
doThrow(IllegalStateException.class).when(aclDAO).findAndEvictClient(client.getId(), 0xbad2, auditLog, "user", new HashMap<>());
resource.evictClient(user, new LongParam(Long.toString(client.getId())), new LongParam(Long.toString(0xbad2)));
}
use of io.dropwizard.jersey.params.LongParam in project keywhiz by square.
the class MembershipResourceTest method canDisallowAccess.
@Test
public void canDisallowAccess() {
Response response = resource.disallowAccess(user, new LongParam(Long.toString(secret.getId())), new LongParam(Long.toString(group.getId())));
assertThat(response.getStatus()).isEqualTo(200);
verify(aclDAO).findAndRevokeAccess(secret.getId(), group.getId(), auditLog, "user", new HashMap<>());
}
use of io.dropwizard.jersey.params.LongParam in project keywhiz by square.
the class MembershipResourceTest method canEnroll.
@Test
public void canEnroll() {
resource.enrollClient(user, new LongParam(Long.toString(client.getId())), new LongParam(Long.toString(group.getId())));
verify(aclDAO).findAndEnrollClient(client.getId(), group.getId(), auditLog, "user", new HashMap<>());
}
Aggregations