ValidationResourceManager implements LoggableResource { public ValidationResource getValidationResource() { if (validationResource == null) { validationResource = new ValidationResource(); } return validationResource; } ValidationResourceManager(Vertx vertx, final ResourceStorage storage, String validationUri); ValidationResource getValidationResource(); @Override void enableResourceLogging(boolean resourceLoggingEnabled); boolean handleValidationResource(final HttpServerRequest request);  }
@Test public void testInitWithValidResource(TestContext context){ validationResourceManager = new ValidationResourceManager(vertx, new MockResourceStorage(ImmutableMap.of(VALIDATION_URI, VALIDATION_RESOURCE_VALID)), VALIDATION_URI); ValidationResource res = validationResourceManager.getValidationResource(); context.assertFalse(res.getResources().isEmpty(), "Creating ValidationResourceManager with a valid Resource should not result in an empty resources list"); }
@Test public void testInitWithInvalidResource(TestContext context){ validationResourceManager = new ValidationResourceManager(vertx, new MockResourceStorage(ImmutableMap.of(VALIDATION_URI, VALIDATION_RESOURCE_INVALID)), VALIDATION_URI); ValidationResource res = validationResourceManager.getValidationResource(); context.assertTrue(res.getResources().isEmpty(), "Creating ValidationResourceManager with an invalid Resource should result in an empty resources list"); validationResourceManager = new ValidationResourceManager(vertx, new MockResourceStorage(ImmutableMap.of(VALIDATION_URI, VALIDATION_RESOURCE_INVALID_2)), VALIDATION_URI); res = validationResourceManager.getValidationResource(); context.assertTrue(res.getResources().isEmpty(), "Creating ValidationResourceManager with an invalid Resource should result in an empty resources list"); validationResourceManager = new ValidationResourceManager(vertx, new MockResourceStorage(ImmutableMap.of(VALIDATION_URI, VALIDATION_RESOURCE_VALID_3)), VALIDATION_URI); res = validationResourceManager.getValidationResource(); context.assertFalse(res.getResources().isEmpty(), "Creating ValidationResourceManager with a Resource missing the 'methods' property should not result in an empty resources list"); }