### Question:
DataImporter extends ProcessDefinition { @Override public void buildProcess(ProcessInstance instance, ResourceResolver rr) throws LoginException, RepositoryException { if (data == null && importFile != null) { try { data = new Spreadsheet(enableHeaderNameConversion, importFile, PATH).buildSpreadsheet(); if (presortData) { Collections.sort(data.getDataRowsAsCompositeVariants(), (a, b) -> b.get(PATH).toString().compareTo(a.get(PATH).toString())); } instance.getInfo().setDescription("Import " + data.getFileName() + " (" + data.getRowCount() + " rows)"); } catch (IOException ex) { LOG.error("Unable to process import", ex); instance.getInfo().setDescription("Import " + data.getFileName() + " (failed)"); throw new RepositoryException("Unable to parse input file", ex); } } instance.defineCriticalAction("Import Data", rr, this::importData); }  @Override void init(); @Override void buildProcess(ProcessInstance instance, ResourceResolver rr); @Override synchronized void storeReport(ProcessInstance instance, ResourceResolver rr); void handleMissingNode(String path, ResourceResolver rr, Map<String, CompositeVariant> row); static final String TOTAL; }### Answer:
@Test public void assertCreatedNodes() throws LoginException, RepositoryException { importer.buildProcess(process, rr); process.run(rr); assertNotNull("Node1 wasn't created", rr.getResource("/tmp/node1")); assertNotNull("Node2 wasn't created", rr.getResource("/tmp/node2")); }
@Test public void assertHintedTypes() throws LoginException, RepositoryException { importer.buildProcess(process, rr); process.run(rr); ValueMap values = rr.getResource("/tmp/node1").getValueMap(); assertEquals((Long) 1234L, values.get("int2", Long.class)); assertNotNull(values.get("date3", Calendar.class)); assertNotNull(values.get("date4", Calendar.class)); assertNotNull(values.get("date5", Calendar.class)); assertNotNull(values.get("date6", Calendar.class)); }
@Test public void assertDetectedTypes() throws LoginException, RepositoryException { importer.buildProcess(process, rr); process.run(rr); ValueMap values = rr.getResource("/tmp/node1").getValueMap(); assertEquals((Long) 123L, values.get("int1", Long.class)); assertEquals(123.456, values.get("double1", Double.class), 0.001); assertEquals("123.456",values.get("double2str", String.class)); Calendar cal = values.get("date1", Calendar.class); assertEquals(1985, cal.get(Calendar.YEAR)); assertEquals(Calendar.NOVEMBER, cal.get(Calendar.MONTH)); assertEquals((Long) 26L, Long.valueOf(cal.get(Calendar.DAY_OF_MONTH))); cal = values.get("date2", Calendar.class); assertEquals(1985, cal.get(Calendar.YEAR)); assertEquals(Calendar.NOVEMBER, cal.get(Calendar.MONTH)); assertEquals(26, cal.get(Calendar.DAY_OF_MONTH)); cal = values.get("time", Calendar.class); assertEquals(9, cal.get(Calendar.HOUR_OF_DAY)); assertEquals(0, cal.get(Calendar.MINUTE)); assertEquals(0, cal.get(Calendar.SECOND)); }