use of org.ovirt.engine.api.model.Permit in project ovirt-engine by oVirt.
the class BackendRolesResourceTest method testAddRoleInvalidPermit.
@Test
public void testAddRoleInvalidPermit() throws Exception {
setUriInfo(setUpBasicUriExpectations());
Role model = new Role();
model.setName(NAMES[0]);
model.setPermits(new Permits());
model.getPermits().getPermits().add(new Permit());
model.getPermits().getPermits().get(0).setId("1234");
try {
Response response = collection.add(model);
fail("expected WebApplicationException");
} catch (WebApplicationException wae) {
assertEquals(BAD_REQUEST, wae.getResponse().getStatus());
assertEquals("1234 is not a valid permit ID.", wae.getResponse().getEntity());
}
}
Aggregations