Search in sources :

Example 1 with LocationNames

use of nl.knaw.huygens.timbuctoo.model.LocationNames in project timbuctoo by HuygensING.

the class DefaultDefaultLocationNamePropertyParserTest method parseReturnsOutputOfPlaceNameGetDefaultName.

@Test
public void parseReturnsOutputOfPlaceNameGetDefaultName() throws JsonProcessingException {
    LocationNames locationNames = new LocationNames("defLang");
    locationNames.addCountryName("defLang", "Nederland");
    String value = instance.parse(new ObjectMapper().writeValueAsString(locationNames));
    assertThat(value, is(locationNames.getDefaultName()));
}
Also used : LocationNames(nl.knaw.huygens.timbuctoo.model.LocationNames) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Example 2 with LocationNames

use of nl.knaw.huygens.timbuctoo.model.LocationNames in project timbuctoo by HuygensING.

the class DefaultDefaultLocationNamePropertyParserTest method parseForSortReturnsOutputOfPlaceNameGetDefaultName.

@Test
public void parseForSortReturnsOutputOfPlaceNameGetDefaultName() throws JsonProcessingException {
    LocationNames locationNames = new LocationNames("defLang");
    locationNames.addCountryName("defLang", "Nederland");
    Object value = instance.parseForSort(new ObjectMapper().writeValueAsString(locationNames));
    assertThat(value, is(locationNames.getDefaultName()));
}
Also used : LocationNames(nl.knaw.huygens.timbuctoo.model.LocationNames) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Example 3 with LocationNames

use of nl.knaw.huygens.timbuctoo.model.LocationNames in project timbuctoo by HuygensING.

the class DefaultDefaultLocationNamePropertyParserTest method parseForSortRemovesTheTrailingWhitespaces.

@Test
public void parseForSortRemovesTheTrailingWhitespaces() throws JsonProcessingException {
    LocationNames locationNames = new LocationNames("defLang");
    locationNames.addCountryName("defLang", "Nederland    ");
    Object value = instance.parseForSort(new ObjectMapper().writeValueAsString(locationNames));
    assertThat(value, is("Nederland"));
}
Also used : LocationNames(nl.knaw.huygens.timbuctoo.model.LocationNames) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Example 4 with LocationNames

use of nl.knaw.huygens.timbuctoo.model.LocationNames in project timbuctoo by HuygensING.

the class DefaultDefaultLocationNamePropertyParserTest method parseForSortRemovesTheLeadingWhitespaces.

@Test
public void parseForSortRemovesTheLeadingWhitespaces() throws JsonProcessingException {
    LocationNames locationNames = new LocationNames("defLang");
    locationNames.addCountryName("defLang", "  Nederland");
    Object value = instance.parseForSort(new ObjectMapper().writeValueAsString(locationNames));
    assertThat(value, is("Nederland"));
}
Also used : LocationNames(nl.knaw.huygens.timbuctoo.model.LocationNames) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)4 LocationNames (nl.knaw.huygens.timbuctoo.model.LocationNames)4 Test (org.junit.Test)4