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 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 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<>());
}
use of io.dropwizard.jersey.params.LongParam in project keywhiz by square.
the class MembershipResourceTest method canAllowAccess.
@Test
public void canAllowAccess() {
Response response = resource.allowAccess(user, new LongParam("66"), new LongParam("55"));
assertThat(response.getStatus()).isEqualTo(200);
verify(aclDAO).findAndAllowAccess(66, 55, auditLog, "user", new HashMap<>());
}
use of io.dropwizard.jersey.params.LongParam in project keywhiz by square.
the class MembershipResourceTest method canEvict.
@Test
public void canEvict() {
resource.evictClient(user, new LongParam(Long.toString(client.getId())), new LongParam(Long.toString(group.getId())));
verify(aclDAO).findAndEvictClient(client.getId(), group.getId(), auditLog, "user", new HashMap<>());
}
Aggregations