use of com.helger.commons.locale.country.CountryCache in project ph-masterdata by phax.
the class VehicleSignsTest method testGetSingleCountryFromVehicleSign.
@Test
public void testGetSingleCountryFromVehicleSign() {
final CountryCache aCC = CountryCache.getInstance();
assertEquals(aCC.getCountry("AT"), VehicleSigns.getSingleCountryFromVehicleSign("A"));
assertNull(VehicleSigns.getSingleCountryFromVehicleSign("XYZ"));
try {
// Has 2 countries
VehicleSigns.getSingleCountryFromVehicleSign("ROK");
fail();
} catch (final IllegalArgumentException ex) {
// expected
}
}
use of com.helger.commons.locale.country.CountryCache in project ph-masterdata by phax.
the class VehicleSignsTest method testGetAllCountriesFromVehicleSign.
@Test
public void testGetAllCountriesFromVehicleSign() {
final CountryCache aCC = CountryCache.getInstance();
assertEquals(new CommonsLinkedHashSet<>(aCC.getCountry("AT")), VehicleSigns.getAllCountriesFromVehicleSign("A"));
assertEquals(new CommonsLinkedHashSet<>(), VehicleSigns.getAllCountriesFromVehicleSign("XYZ"));
// Has 2 countries
assertEquals(new CommonsLinkedHashSet<>(aCC.getCountry("KP"), aCC.getCountry("KR")), VehicleSigns.getAllCountriesFromVehicleSign("ROK"));
}
Aggregations