### Question:
JmsAuditEventHandlerFactory implements AuditEventHandlerFactory { @Override public AuditEventHandler create(AuditEventHandlerConfiguration configuration) throws AuditException { Map<String, Set<String>> attributes = configuration.getAttributes(); JmsAuditEventHandlerConfiguration handlerConfig = new JmsAuditEventHandlerConfiguration(); handlerConfig.setTopics(attributes.get("topics")); handlerConfig.setName(configuration.getHandlerName()); handlerConfig.setEnabled(getBooleanMapAttr(attributes, "enabled", false)); handlerConfig.setBatch(getBatchPublisherConfig(attributes)); handlerConfig.setDeliveryMode(getDeliveryModeConfig(attributes)); handlerConfig.setJndi(getJndiConfig(attributes)); handlerConfig.setSessionMode(getSessionModeConfig(attributes)); try { return new JmsAuditEventHandler(null, handlerConfig, configuration.getEventTopicsMetaData()); } catch (ResourceException e) { throw new AuditException(e); } }  @Override AuditEventHandler create(AuditEventHandlerConfiguration configuration);  }### Answer:
@Test private void canCreateAuditHandlerWithBareMinimumFields() throws AuditException { configAttributes.put("enabled", singleton("true")); configAttributes.put("topics", singleton("access")); configAttributes.put("batchEnabled", singleton("false")); configAttributes.put("deliveryMode", singleton(DeliveryModeConfig.NON_PERSISTENT.name())); configAttributes.put("sessionMode", singleton(SessionModeConfig.AUTO.name())); Set<String> jndiContext = new HashSet<>(); jndiContext.add("[java.naming.factory.initial]=org.apache.activemq.jndi.ActiveMQInitialContextFactory"); jndiContext.add("[java.naming.provider.url]=tcp: jndiContext.add("[topic.audit]=audit"); configAttributes.put("jndiContextProperties", jndiContext); configAttributes.put("jndiTopicName", singleton("audit")); configAttributes.put("jndiConnectionFactoryName", singleton("ConnectionFactory")); AuditEventHandlerConfiguration configuration = AuditEventHandlerConfiguration.builder() .withName("JMS Handler") .withAttributes(configAttributes) .withEventTopicsMetaData(eventTopicsMetaData).build(); AuditEventHandler handler = factory.create(configuration); assertThat(handler).isInstanceOf(JmsAuditEventHandler.class); assertThat(handler.getName()).isEqualTo("JMS Handler"); assertThat(handler.isEnabled()).isTrue(); assertThat(handler.getHandledTopics()).containsExactly("access"); }