use of ddf.catalog.data.impl.MetacardTypeImpl in project ddf by codice.
the class RegistryTransformerTest method setUp.
@Before
public void setUp() {
registryTransformer = new RegistryTransformer();
parser = new XmlParser();
metacardTypes = new ArrayList<>();
metacardTypes.addAll(Arrays.asList(new RegistryObjectMetacardType(), new TopicAttributes(), new MediaAttributes(), new ContactAttributes(), new CoreAttributes(), new DateTimeAttributes()));
metacardType = new MetacardTypeImpl("registryMetacard", metacardTypes);
registryTransformer.setParser(parser);
registryTransformer.setRegistryMetacardType(metacardType);
System.setProperty(RegistryConstants.REGISTRY_ID_PROPERTY, "identityRegistryId");
}
use of ddf.catalog.data.impl.MetacardTypeImpl in project ddf by codice.
the class ConfluenceSourceTest method setup.
@Before
public void setup() {
MetacardType type = new MetacardTypeImpl("confluence", (List) null);
transformer = new ConfluenceInputTransformer(type);
encryptionService = mock(EncryptionService.class);
reader = mock(ResourceReader.class);
factory = mock(SecureCxfClientFactory.class);
client = mock(SearchResource.class);
clientResponse = mock(Response.class);
when(factory.getClient()).thenReturn(client);
doReturn(clientResponse).when(client).search(anyString(), anyString(), anyString(), anyString(), anyInt(), anyInt(), anyBoolean());
when(encryptionService.decryptValue(anyString())).thenReturn("decryptedPass");
confluence = new TestConfluenceSource(adapter, encryptionService, transformer, reader, factory);
confluence.setAvailabilityPollInterval(1);
confluence.setConfigurationPid("configPid");
confluence.setEndpointUrl("https://confluence/rest/api/content");
confluence.setExpandedSections(Collections.singletonList("expandedField"));
confluence.setUsername("username");
confluence.setPassword("password");
confluence.setIncludeArchivedSpaces(false);
List<String> additionalAttributes = new ArrayList<>();
additionalAttributes.add("attrib1=val1");
additionalAttributes.add("attrib2=val1,val2,val3");
confluence.setAdditionalAttributes(additionalAttributes);
}
use of ddf.catalog.data.impl.MetacardTypeImpl in project ddf by codice.
the class FilterPluginTest method getNoSecurityAttributeMetacard.
private Metacard getNoSecurityAttributeMetacard() {
MetacardImpl metacard = new MetacardImpl();
metacard.setResourceSize("100");
try {
metacard.setResourceURI(new URI("http://some.fancy.uri/goes/here"));
} catch (URISyntaxException e) {
LOGGER.error("", e);
}
//Intentionally do not set the Metacard.SECURITY attribute
metacard.setContentTypeName("Resource");
metacard.setTitle("Metacard 1");
metacard.setContentTypeVersion("1");
metacard.setType(new MetacardTypeImpl(MetacardType.DEFAULT_METACARD_TYPE_NAME, new HashSet<>()));
return metacard;
}
use of ddf.catalog.data.impl.MetacardTypeImpl in project ddf by codice.
the class FilterPluginTest method getExactRolesMetacard.
private Metacard getExactRolesMetacard() {
MetacardImpl metacard = new MetacardImpl();
metacard.setResourceSize("100");
try {
metacard.setResourceURI(new URI("http://some.fancy.uri/goes/here"));
} catch (URISyntaxException e) {
LOGGER.error("", e);
}
metacard.setContentTypeName("Resource");
metacard.setTitle("Metacard 1");
metacard.setContentTypeVersion("1");
metacard.setType(new MetacardTypeImpl(MetacardType.DEFAULT_METACARD_TYPE_NAME, new HashSet<>()));
HashMap<String, List<String>> security = new HashMap<>();
security.put("Roles", Arrays.asList("A", "B"));
metacard.setSecurity(security);
metacard.setId("exactroles");
return metacard;
}
use of ddf.catalog.data.impl.MetacardTypeImpl in project ddf by codice.
the class FilterPluginTest method getMissingRolesMetacard.
private Metacard getMissingRolesMetacard() {
MetacardImpl metacard = new MetacardImpl();
metacard.setResourceSize("100");
try {
metacard.setResourceURI(new URI("http://some.fancy.uri/goes/here"));
} catch (URISyntaxException e) {
LOGGER.error("", e);
}
metacard.setContentTypeName("Resource");
metacard.setTitle("Metacard 1");
metacard.setContentTypeVersion("1");
metacard.setType(new MetacardTypeImpl(MetacardType.DEFAULT_METACARD_TYPE_NAME, new HashSet<>()));
HashMap<String, List<String>> security = new HashMap<>();
security.put("Roles", Arrays.asList("A"));
metacard.setSecurity(security);
return metacard;
}
Aggregations