* ============LICENSE_END============================================
* ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
-package org.onap.aai.champ.ie;
+package org.onap.aai.champcore.ie;
import static org.junit.Assert.assertTrue;
import java.util.Optional;
import org.junit.Test;
-import org.onap.aai.champ.ChampAPI;
-import org.onap.aai.champ.ChampGraph;
-import org.onap.aai.champ.ie.GraphMLImporterExporter;
+import org.onap.aai.champcore.ChampAPI;
+import org.onap.aai.champcore.ChampGraph;
+import org.onap.aai.champcore.exceptions.ChampTransactionException;
public class ImportTest {
private final String GRAPH_NAME = "unit-test";
@Test
- public void testGraphMLImport() {
+ public void testGraphMLImport() throws ChampTransactionException, AssertionError {
final GraphMLImporterExporter importer = new GraphMLImporterExporter();
- final ChampAPI api = ChampAPI.Factory.newInstance(ChampGraph.Type.IN_MEMORY);
+ final ChampAPI api = ChampAPI.Factory.newInstance("IN_MEMORY");
importer.importData(api, getClass().getClassLoader().getResourceAsStream("import-test.graphml"));
final ChampGraph graph = api.getGraph(GRAPH_NAME);
- graph.queryObjects(Collections.emptyMap()).forEach(object -> {
+ graph.queryObjects(Collections.emptyMap(), Optional.empty()).forEach(object -> {
final Optional<String> nameOpt = object.getProperty("name");
final Optional<Boolean> studentOpt = object.getProperty("student");
final Optional<Long> worthOpt = object.getProperty("worth");