### Question:
DnsProvisioningAdapter extends SimpleQueuedProvisioningAdapter implements InitializingBean { @Override public void processPendingOperationForNode(final AdapterOperation op) throws ProvisioningAdapterException { if (m_resolver == null) { return; } log().info("processPendingOperationForNode: Handling Operation: "+op); if (op.getType() == AdapterOperationType.ADD || op.getType() == AdapterOperationType.UPDATE) { m_template.execute(new TransactionCallback<Object>() { public Object doInTransaction(TransactionStatus arg0) { doUpdate(op); return null; } }); } else if (op.getType() == AdapterOperationType.DELETE) { m_template.execute(new TransactionCallback<Object>() { public Object doInTransaction(TransactionStatus arg0) { doDelete(op); return null; } }); } else if (op.getType() == AdapterOperationType.CONFIG_CHANGE) { } else { log().warn("unknown operation: " + op.getType()); } }  @Override void afterPropertiesSet(); NodeDao getNodeDao(); void setNodeDao(NodeDao dao); void setEventForwarder(EventForwarder eventForwarder); EventForwarder getEventForwarder(); String getName(); @Override boolean isNodeReady(AdapterOperation op); @Override void processPendingOperationForNode(final AdapterOperation op); void setTemplate(TransactionTemplate template); TransactionTemplate getTemplate();  }### Answer:
@Test @Transactional @JUnitDNSServer(port=9153, zones={ @DNSZone(name="example.com", entries={ @DNSEntry(hostname="test", address="192.168.0.1") }) }) public void testAdd() throws Exception { OnmsNode n = m_nodeDao.findByForeignId("dns", "1"); m_adapter.addNode(n.getId()); m_adapter.processPendingOperationForNode(m_addOperation); }
@Test @Transactional @JUnitDNSServer(port=9153, zones={ @DNSZone(name="example.com", entries={ @DNSEntry(hostname="test", address="192.168.0.1") }) }) public void testDelete() throws Exception { OnmsNode n = m_nodeDao.findByForeignId("dns", "1"); m_adapter.deleteNode(n.getId()); m_adapter.processPendingOperationForNode(m_deleteOperation); }