use of org.codice.alliance.transformer.nitf.NitfAttributeConverters 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