Search in sources :

Example 1 with ErrorType

use of org.openforis.collect.io.metadata.parsing.ParsingError.ErrorType in project collect by openforis.

the class SpeciesImportProcessIntegrationTest method testInvalidColumns.

@Test
public void testInvalidColumns() throws Exception {
    SpeciesImportProcess process = importCSVFile(INVALID_MISSING_COLUMNS_TEST_CSV);
    SpeciesImportStatus status = process.getStatus();
    assertTrue(status.isError());
    List<ParsingError> errors = status.getErrors();
    assertEquals(1, errors.size());
    ParsingError error = errors.get(0);
    ErrorType errorType = error.getErrorType();
    assertEquals(ErrorType.MISSING_REQUIRED_COLUMNS, errorType);
}
Also used : ParsingError(org.openforis.collect.io.metadata.parsing.ParsingError) ErrorType(org.openforis.collect.io.metadata.parsing.ParsingError.ErrorType) SpeciesImportProcess(org.openforis.collect.manager.speciesimport.SpeciesImportProcess) SpeciesImportStatus(org.openforis.collect.manager.speciesimport.SpeciesImportStatus) CollectIntegrationTest(org.openforis.collect.CollectIntegrationTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 CollectIntegrationTest (org.openforis.collect.CollectIntegrationTest)1 ParsingError (org.openforis.collect.io.metadata.parsing.ParsingError)1 ErrorType (org.openforis.collect.io.metadata.parsing.ParsingError.ErrorType)1 SpeciesImportProcess (org.openforis.collect.manager.speciesimport.SpeciesImportProcess)1 SpeciesImportStatus (org.openforis.collect.manager.speciesimport.SpeciesImportStatus)1