use of org.codice.ddf.internal.country.converter.api.CountryCodeConverter in project alliance by codice.
the class NitfTestCommons method setupNitfUtilities.
// This method is needed even though the NitfUtilties object created is not used. It will populate
// the static CountryCodeConverter reference of the NitfUtilies for use in these tests
public static void setupNitfUtilities(String fromCode, List<String> toCodes) {
CountryCodeConverter mockCountryCodeConverter = mock(CountryCodeConverter.class);
doReturn(toCodes).when(mockCountryCodeConverter).convertFipsToIso3(fromCode);
new NitfAttributeConverters(mockCountryCodeConverter);
}
use of org.codice.ddf.internal.country.converter.api.CountryCodeConverter in project alliance by codice.
the class NitfHeaderAttributeTest method testNitfFileReleasabilityWithMultipleSpaces.
@Test
public void testNitfFileReleasabilityWithMultipleSpaces() throws Exception {
CountryCodeConverter mockCountryCodeConverter = mock(CountryCodeConverter.class);
doReturn(Collections.singletonList("USA")).when(mockCountryCodeConverter).convertFipsToIso3("US");
doReturn(Collections.singletonList("GBR")).when(mockCountryCodeConverter).convertFipsToIso3("GB");
new NitfAttributeConverters(mockCountryCodeConverter);
FileSecurityMetadata fsmMock = mock(FileSecurityMetadata.class);
when(nitfHeader.getFileSecurityMetadata()).thenReturn(fsmMock);
when(nitfHeader.getFileSecurityMetadata().getReleaseInstructions()).thenReturn("US GB");
Serializable value = NitfHeaderAttribute.FILE_RELEASING_INSTRUCTIONS_ATTRIBUTE.getAccessorFunction().apply(nitfHeader);
assertThat(value, is(equalTo("USA GBR")));
}
Aggregations