assertEquals(44, definitions.size());
}
+ /**
+ * Test that checks if securitySchemes and security elements are present.
+ */
+ @Test
+ public void testAuthenticationFeature() {
+ final var module = context.findModule(TOASTER_2, Revision.of(REVISION_DATE)).orElseThrow();
+ final var doc = generator.getOpenApiSpec(module, "http", "localhost:8181", "/", "", context);
+
+ assertEquals("[{\"basicAuth\":[]}]", doc.security().toString());
+ assertEquals("{\"type\":\"http\",\"scheme\":\"basic\"}",
+ doc.components().securitySchemes().basicAuth().toString());
+ }
+
/**
* Test JSON and XML references for request operation.
*/
assertTrue(mountPointApi.paths().containsKey(pathWithoutParameters));
assertEquals(List.of(), getPathParameters(mountPointApi.paths(), pathWithoutParameters));
}
+
+ /**
+ * Test that checks if securitySchemes and security elements are present.
+ */
+ @Test
+ public void testAuthenticationFeature() throws Exception {
+ final var mockInfo = DocGenTestHelper.createMockUriInfo(HTTP_URL);
+ openApi.onMountPointCreated(INSTANCE_ID);
+ final var mountPointApi = openApi.getMountPointApi(mockInfo, 1L, Optional.empty());
+
+ assertEquals("[{\"basicAuth\":[]}]", mountPointApi.security().toString());
+ assertEquals("{\"type\":\"http\",\"scheme\":\"basic\"}",
+ mountPointApi.components().securitySchemes().basicAuth().toString());
+ }
}