LoggingResourceManager implements LoggableResource { public LoggingResource getLoggingResource() { if (loggingResource == null) { loggingResource = new LoggingResource(); } return loggingResource; } LoggingResourceManager(Vertx vertx, final ResourceStorage storage, String loggingUri); LoggingResource getLoggingResource(); @Override void enableResourceLogging(boolean resourceLoggingEnabled); boolean handleLoggingResource(final HttpServerRequest request);  }
@Test public void testLoggingResourceContent(TestContext context){ storage = new MockResourceStorage(ImmutableMap.of(LOGGING_URI, VALID_LOGGING_RESOURCE)); LoggingResourceManager manager = new LoggingResourceManager(vertx, storage, LOGGING_URI); LoggingResource loggingResource = manager.getLoggingResource(); List<Map<String, String>> payloadFilterEntries = loggingResource.getPayloadFilters(); context.assertEquals(2, payloadFilterEntries.size()); Map<String, Map<String, String>> destinationEntries = loggingResource.getDestinationEntries(); context.assertEquals(2, destinationEntries.size()); context.assertTrue(destinationEntries.containsKey("fileLog")); Map<String, String> fileLogProperties = destinationEntries.get("fileLog"); assertFilterProperty(context, fileLogProperties, TYPE, FILE); assertFilterProperty(context, fileLogProperties, FILE, "requests.log"); context.assertFalse(fileLogProperties.containsKey(METADATA)); context.assertFalse(fileLogProperties.containsKey(TRANSMISSION)); context.assertTrue(destinationEntries.containsKey("eventBusLog")); Map<String, String> eventBusLogProperties = destinationEntries.get("eventBusLog"); assertFilterProperty(context, eventBusLogProperties, TYPE, EVENT_BUS); assertFilterProperty(context, eventBusLogProperties, ADDRESS, "some_eventbus_address"); assertFilterProperty(context, eventBusLogProperties, METADATA, "meta 1"); assertFilterProperty(context, eventBusLogProperties, TRANSMISSION, "send"); }