SimpleIrdEntryListener implements AutoCloseable, DataTreeChangeListener<IrdConfigurationEntry> { protected boolean isValidResource(Resource resource) { if (resource.getType() == null) { LOG.error("Resource {} missing 'type' field", resource.getResourceId().getValue()); return false; } return true; } SimpleIrdEntryListener(InstanceIdentifier<Resource> instance, Uuid entryContext); void register(DataBroker dataBroker, InstanceIdentifier<IrdConfigurationEntry> iid); @Override synchronized void onDataTreeChanged(Collection<DataTreeModification<IrdConfigurationEntry>> changes); @Override synchronized void close();  }
@Test public void isValidResource() throws Exception { ResourceBuilder rb = new ResourceBuilder() .setKey(new ResourceKey(new ResourceId("test"))) .setType(null); assertEquals(simpleIrdEntryListener.isValidResource(rb.build()), false); }