@Override protected void verifyModel(Permission model, int index) { super.verifyModel(model, index); if (index == 0) { assertTrue(model.isSetUser()); assertEquals(GUIDS[1].toString(), model.getUser().getId()); } else { assertTrue(model.isSetGroup()); assertEquals(GUIDS[1].toString(), model.getGroup().getId()); } }
@Test public void testAddIncompletePermission() throws Exception { Permission model = new Permission(); model.setUser(new User()); model.getUser().setId(GUIDS[1].toString()); model.setRole(new Role()); model.getRole().setId(GUIDS[3].toString()); setUriInfo(setUpBasicUriExpectations()); control.replay(); try { collection.add(model); } catch (WebApplicationException wae) { verifyIncompleteException( wae, "Permission", "add", "dataCenter|cluster|host|storageDomain|vm|vmpool|template.id"); } }