CliTrigger implements AutoCloseable { private void registerUserVnPnMappingListener() { InstanceIdentifier<UserVnPnMapping> userVnPnMappingIid = InstanceIdentifier .builder(VnPnMappingResults.class) .child(UserVnPnMapping.class) .build(); userVnPnMappingChangeListenerReg = dataProvider.registerDataTreeChangeListener(new DataTreeIdentifier<>( LogicalDatastoreType.CONFIGURATION, userVnPnMappingIid), new UserVnPnMappingChangeListener()); } CliTrigger(DataBroker dataProvider); @Override void close();  }
@Test public void testRegisterUserVnPnMappingListener() throws Exception{ Class<CliTrigger> class1 = CliTrigger.class; Method method = class1.getDeclaredMethod("registerUserVnPnMappingListener"); method.setAccessible(true); method.invoke(cliTrigger); }