use of org.ovirt.engine.api.model.Roles in project ovirt-engine by oVirt.
the class CompletenessAssertorTest method testCompleteListSubField.
@Test
public void testCompleteListSubField() throws Exception {
User user = new User();
user.setRoles(new Roles());
user.getRoles().getRoles().add(new Role());
user.getRoles().getRoles().get(0).setId("0");
user.getRoles().getRoles().add(new Role());
user.getRoles().getRoles().get(1).setId("0");
CompletenessAssertor.validateParameters(user, "roles.id");
}
use of org.ovirt.engine.api.model.Roles in project ovirt-engine by oVirt.
the class CompletenessAssertorTest method testMissingListSubField.
@Test
public void testMissingListSubField() throws Exception {
User user = new User();
user.setRoles(new Roles());
user.getRoles().getRoles().add(new Role());
user.getRoles().getRoles().get(0).setId("0");
user.getRoles().getRoles().add(new Role());
user.getRoles().getRoles().get(1).setName("0");
try {
CompletenessAssertor.validateParameters(user, "roles.id");
fail("expected WebApplicationException on incomplete model");
} catch (WebApplicationException wae) {
verifyIncompleteException(wae, "User", "roles.id");
}
}
Aggregations