use of ddf.catalog.data.MetacardType in project ddf by codice.
the class TestMetacardTypeAdapter method testUnmarshalWithEmptyRegisteredMetacardTypes.
@Test
public void testUnmarshalWithEmptyRegisteredMetacardTypes() throws CatalogTransformerException {
MetacardTypeAdapter metacardTypeAdpater = new MetacardTypeAdapter(EMPTY_METACARD_TYPES_LIST);
MetacardType metacardType = metacardTypeAdpater.unmarshal(UNKNOWN_TYPE_NAME);
assertThat(metacardType.getName(), is(BasicTypes.BASIC_METACARD.getName()));
}
use of ddf.catalog.data.MetacardType in project ddf by codice.
the class AttributeInjectorImpl method injectAttributes.
@Override
public Metacard injectAttributes(Metacard original) {
notNull(original, "The metacard cannot be null.");
final MetacardType newMetacardType = injectAttributes(original.getMetacardType());
if (newMetacardType == original.getMetacardType()) {
return original;
} else {
return changeMetacardType(original, newMetacardType);
}
}
use of ddf.catalog.data.MetacardType in project ddf by codice.
the class AttributeInjectorImplTest method testInjectIntoMetacardType.
@Test
public void testInjectIntoMetacardType() {
final MetacardType expectedBasicMetacardType = new MetacardTypeImpl(BASIC_METACARD.getName(), BASIC_METACARD, Sets.newHashSet(globalAttribute, basicAttribute, basicAndNitfAttribute));
assertThat(attributeInjector.injectAttributes(BASIC_METACARD), is(expectedBasicMetacardType));
final MetacardType expectedNitfMetacardType = new MetacardTypeImpl(NITF, NITF_TYPE, Sets.newHashSet(globalAttribute, basicAndNitfAttribute));
assertThat(attributeInjector.injectAttributes(NITF_TYPE), is(expectedNitfMetacardType));
}
Aggregations