use of org.hisp.dhis.webapi.json.domain.JsonError in project dhis2-core by dhis2.
the class FollowupAnalysisControllerTest method testPerformFollowupAnalysis_ValidationMaxResultsOverLimit.
@Test
void testPerformFollowupAnalysis_ValidationMaxResultsOverLimit() {
JsonError error = GET("/dataAnalysis/followup?ou={ou}&de={de}&pe=2021&maxResults=11111", orgUnitId, dataElementId).error(HttpStatus.CONFLICT);
assertEquals(ErrorCode.E2206, error.getErrorCode());
assertEquals("Max results exceeds the allowed max limit: `" + NumberFormat.getInstance().format(10000) + "`", error.getMessage());
}
use of org.hisp.dhis.webapi.json.domain.JsonError in project dhis2-core by dhis2.
the class FollowupAnalysisControllerTest method testPerformFollowupAnalysis_ValidationStartDateNotBeforeEndDate.
@Test
void testPerformFollowupAnalysis_ValidationStartDateNotBeforeEndDate() {
JsonError error = GET("/dataAnalysis/followup?ou={ou}&de={de}&startDate=2020-01-01&endDate=2019-01-01", orgUnitId, dataElementId).error(HttpStatus.CONFLICT);
assertEquals(ErrorCode.E2202, error.getErrorCode());
assertEquals("Start date must be before end date", error.getMessage());
}
use of org.hisp.dhis.webapi.json.domain.JsonError in project dhis2-core by dhis2.
the class FollowupAnalysisControllerTest method testPerformFollowupAnalysis_ValidationMaxResultsZeroOrNegative.
@Test
void testPerformFollowupAnalysis_ValidationMaxResultsZeroOrNegative() {
JsonError error = GET("/dataAnalysis/followup?ou={ou}&de={de}&pe=2021&maxResults=0", orgUnitId, dataElementId).error(HttpStatus.CONFLICT);
assertEquals(ErrorCode.E2205, error.getErrorCode());
assertEquals("Max results must be a positive number", error.getMessage());
}
use of org.hisp.dhis.webapi.json.domain.JsonError in project dhis2-core by dhis2.
the class FollowupAnalysisControllerTest method testPerformFollowupAnalysis_ValidationMissingEndDate.
@Test
void testPerformFollowupAnalysis_ValidationMissingEndDate() {
JsonError error = GET("/dataAnalysis/followup?ou={ou}&de={de}&startDate=2020-01-01", orgUnitId, dataElementId).error(HttpStatus.CONFLICT);
assertEquals(ErrorCode.E2301, error.getErrorCode());
assertEquals("Start date and end date must be specified directly or indirectly by specifying a period", error.getMessage());
}
Aggregations