use of uk.ac.ebi.spot.goci.model.ValidationError in project goci by EBISPOT.
the class ErrorCreationServiceTest method testCheckRangeIsPresent.
@Test
public void testCheckRangeIsPresent() throws Exception {
when(validationChecks.checkValueIsPresent("")).thenReturn("Value is empty");
ValidationError error1 = errorCreationService.checkRangeIsPresent("");
assertThat(error1).extracting("field", "error", "warning").contains("Range", "Value is empty", true);
when(validationChecks.checkValueIsPresent(Matchers.anyString())).thenReturn(null);
ValidationError error2 = errorCreationService.checkRangeIsPresent(Matchers.anyString());
assertThat(error2).extracting("field", "error", "warning").contains(null, null, false);
}
use of uk.ac.ebi.spot.goci.model.ValidationError in project goci by EBISPOT.
the class ErrorCreationServiceTest method testCheckOrPerCopyRecipRangeIsEmpty.
@Test
public void testCheckOrPerCopyRecipRangeIsEmpty() throws Exception {
when(validationChecks.checkValueIsEmpty(Matchers.anyString())).thenReturn("Value is not empty");
ValidationError error1 = errorCreationService.checkOrPerCopyRecipRangeIsEmpty(Matchers.anyString());
assertThat(error1).extracting("field", "error", "warning").contains("OR reciprocal range", "Value is not empty", false);
when(validationChecks.checkValueIsEmpty("")).thenReturn(null);
ValidationError error2 = errorCreationService.checkOrPerCopyRecipRangeIsEmpty("");
assertThat(error2).extracting("field", "error", "warning").contains(null, null, false);
}
use of uk.ac.ebi.spot.goci.model.ValidationError in project goci by EBISPOT.
the class ErrorCreationServiceTest method testCheckOrPerCopyRecipRangeIsPresent.
@Test
public void testCheckOrPerCopyRecipRangeIsPresent() throws Exception {
when(validationChecks.checkValueIsPresent("")).thenReturn("Value is empty");
ValidationError error1 = errorCreationService.checkOrPerCopyRecipRangeIsPresent("");
assertThat(error1).extracting("field", "error", "warning").contains("OR reciprocal range", "Value is empty", true);
when(validationChecks.checkValueIsPresent(Matchers.anyString())).thenReturn(null);
ValidationError error2 = errorCreationService.checkAlleleRiskFrequency(Matchers.anyString());
assertThat(error2).extracting("field", "error", "warning").contains(null, null, false);
}
use of uk.ac.ebi.spot.goci.model.ValidationError in project goci by EBISPOT.
the class ErrorCreationServiceTest method testCheckOrRecipEmpty.
@Test
public void testCheckOrRecipEmpty() throws Exception {
when(validationChecks.checkValueIsEmpty(Matchers.anyFloat())).thenReturn("Value is not empty");
ValidationError error1 = errorCreationService.checkOrRecipEmpty(Matchers.anyFloat());
assertThat(error1).extracting("field", "error", "warning").contains("OR reciprocal", "Value is not empty", false);
Float nullValue = null;
when(validationChecks.checkValueIsEmpty(nullValue)).thenReturn(null);
ValidationError error2 = errorCreationService.checkOrRecipEmpty(nullValue);
assertThat(error2).extracting("field", "error", "warning").contains(null, null, false);
}
use of uk.ac.ebi.spot.goci.model.ValidationError in project goci by EBISPOT.
the class ErrorCreationServiceTest method testCheckStandardErrorIsEmpty.
@Test
public void testCheckStandardErrorIsEmpty() throws Exception {
when(validationChecks.checkValueIsEmpty(Matchers.anyFloat())).thenReturn("Value is not empty");
ValidationError error1 = errorCreationService.checkStandardErrorIsEmpty(Matchers.anyFloat());
assertThat(error1).extracting("field", "error", "warning").contains("Standard Error", "Value is not empty", false);
Float nullNum = null;
when(validationChecks.checkValueIsEmpty(nullNum)).thenReturn(null);
ValidationError error2 = errorCreationService.checkStandardErrorIsEmpty(nullNum);
assertThat(error2).extracting("field", "error", "warning").contains(null, null, false);
}
Aggregations