Search in sources :

Example 6 with InteractTypeMapper

use of org.eol.globi.util.InteractTypeMapper in project eol-globi-data by jhpoelen.

the class DatasetImporterForMetaTableTest method interactionTypeMapping.

@Test
public void interactionTypeMapping() {
    InteractTypeMapper mapper = new InteractTypeMapper() {

        @Override
        public boolean shouldIgnoreInteractionType(String nameOrId) {
            return false;
        }

        @Override
        public InteractType getInteractType(String nameOrId) {
            return null;
        }
    };
    assertThat(DatasetImporterForMetaTable.generateInteractionType(interactMap("donald"), mapper), is(nullValue()));
}
Also used : InteractTypeMapper(org.eol.globi.util.InteractTypeMapper) Test(org.junit.Test)

Example 7 with InteractTypeMapper

use of org.eol.globi.util.InteractTypeMapper in project eol-globi-data by jhpoelen.

the class DatasetImporterForMetaTableTest method interactionTypeMappingValid.

@Test
public void interactionTypeMappingValid() {
    InteractTypeMapper mapper = new InteractTypeMapper() {

        @Override
        public boolean shouldIgnoreInteractionType(String nameOrId) {
            return false;
        }

        @Override
        public InteractType getInteractType(String nameOrId) {
            return InteractType.POLLINATES;
        }
    };
    assertThat(DatasetImporterForMetaTable.generateInteractionType(interactMap("pollinator"), mapper), is(InteractType.POLLINATES));
}
Also used : InteractTypeMapper(org.eol.globi.util.InteractTypeMapper) Test(org.junit.Test)

Aggregations

InteractTypeMapper (org.eol.globi.util.InteractTypeMapper)7 Test (org.junit.Test)7 ArrayList (java.util.ArrayList)5 Map (java.util.Map)5 InteractType (org.eol.globi.domain.InteractType)5 HashMap (java.util.HashMap)4 NullImportLogger (org.eol.globi.tool.NullImportLogger)4 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 TreeMap (java.util.TreeMap)1 TestUtil.getResourceServiceTest (org.eol.globi.data.TestUtil.getResourceServiceTest)1 InteractionListener (org.eol.globi.process.InteractionListener)1 InteractTypeMapperFactoryImpl (org.eol.globi.util.InteractTypeMapperFactoryImpl)1