use of uk.ac.ebi.spot.goci.model.ValidationError in project goci by EBISPOT.
the class ErrorCreationServiceTest method testCheckAlleleRiskFrequency.
@Test
public void testCheckAlleleRiskFrequency() throws Exception {
when(validationChecks.checkRiskFrequency("10")).thenReturn("Value is invalid, value is not between 0 and 1");
ValidationError error1 = errorCreationService.checkAlleleRiskFrequency("10");
assertThat(error1).extracting("field", "error", "warning").contains("Independent SNP risk allele frequency in controls", "Value is invalid, value is not between 0 and 1", true);
when(validationChecks.checkRiskFrequency("")).thenReturn("Value is empty");
ValidationError error2 = errorCreationService.checkAlleleRiskFrequency("");
assertThat(error2).extracting("field", "error", "warning").contains("Independent SNP risk allele frequency in controls", "Value is empty", true);
when(validationChecks.checkRiskFrequency("0.78")).thenReturn(null);
ValidationError error3 = errorCreationService.checkAlleleRiskFrequency("0.78");
assertThat(error3).extracting("field", "error", "warning").contains(null, null, false);
}
Aggregations