use of io.dropwizard.jersey.params.LongParam in project keywhiz by square.
the class GroupsResourceTest method notFoundWhenDeletingBadId.
@Test(expected = NotFoundException.class)
public void notFoundWhenDeletingBadId() {
when(groupDAO.getGroupById(0x1bad1dea)).thenReturn(Optional.empty());
resource.deleteGroup(user, new LongParam(Long.toString(0x1bad1dea)));
}
use of io.dropwizard.jersey.params.LongParam in project keywhiz by square.
the class MembershipResourceTest method missingSecretDisallow.
@Test(expected = NotFoundException.class)
public void missingSecretDisallow() {
doThrow(IllegalStateException.class).when(aclDAO).findAndRevokeAccess(2, group.getId(), auditLog, "user", new HashMap<>());
resource.disallowAccess(user, new LongParam("2"), new LongParam(Long.toString(group.getId())));
}
use of io.dropwizard.jersey.params.LongParam in project keywhiz by square.
the class MembershipResourceTest method evictThrowsWhenClientIdNotFound.
@Test(expected = NotFoundException.class)
public void evictThrowsWhenClientIdNotFound() {
doThrow(IllegalStateException.class).when(aclDAO).findAndEvictClient(60984, group.getId(), auditLog, "user", new HashMap<>());
resource.evictClient(user, new LongParam("60984"), new LongParam(Long.toString(group.getId())));
}
use of io.dropwizard.jersey.params.LongParam in project keywhiz by square.
the class MembershipResourceTest method enrollThrowsWhenGroupIdNotFound.
@Test(expected = NotFoundException.class)
public void enrollThrowsWhenGroupIdNotFound() {
doThrow(IllegalStateException.class).when(aclDAO).findAndEnrollClient(client.getId(), 0xbad, auditLog, "user", new HashMap<>());
resource.enrollClient(user, new LongParam("44"), new LongParam(Long.toString(0xbad)));
}
use of io.dropwizard.jersey.params.LongParam in project keywhiz by square.
the class MembershipResourceTest method enrollThrowsWhenClientIdNotFound.
@Test(expected = NotFoundException.class)
public void enrollThrowsWhenClientIdNotFound() {
doThrow(IllegalStateException.class).when(aclDAO).findAndEnrollClient(6092384, group.getId(), auditLog, "user", new HashMap<>());
resource.enrollClient(user, new LongParam("6092384"), new LongParam(Long.toString(group.getId())));
}
Aggregations