use of org.hisp.dhis.dxf2.events.enrollment.Enrollment in project dhis2-core by dhis2.
the class TrackerRelationshipCriteriaTest method getIdentifierParamThrowsIfTrackedEntityAndEnrollmentAreSet.
@Test
void getIdentifierParamThrowsIfTrackedEntityAndEnrollmentAreSet() {
TrackerRelationshipCriteria criteria = new TrackerRelationshipCriteria();
criteria.setTrackedEntity("Hq3Kc6HK4OZ");
criteria.setEnrollment("Hq3Kc6HK4OZ");
WebMessageException exception = assertThrows(WebMessageException.class, criteria::getIdentifierParam);
assertEquals(BAD_REQUEST.value(), exception.getWebMessage().getHttpStatusCode());
assertEquals("Only one of parameters 'trackedEntity', 'enrollment' or 'event' is allowed.", exception.getWebMessage().getMessage());
}
Aggregations