use of org.neo4j.server.CommunityNeoWebServer in project neo4j by neo4j.
the class DBMSModuleTest method shouldRegisterAtRootByDefault.
@Test
public void shouldRegisterAtRootByDefault() throws Exception {
WebServer webServer = mock(WebServer.class);
Config config = mock(Config.class);
CommunityNeoWebServer neoServer = mock(CommunityNeoWebServer.class);
when(neoServer.getBaseUri()).thenReturn(new URI("http://localhost:7575"));
when(neoServer.getWebServer()).thenReturn(webServer);
when(config.get(GraphDatabaseSettings.auth_enabled)).thenReturn(true);
when(config.get(ServerSettings.http_paths_blacklist)).thenReturn(emptyList());
var module = new DBMSModule(webServer, config, () -> new DiscoverableURIs.Builder().build(), NullLogProvider.getInstance());
module.start();
verify(webServer).addJAXRSClasses(anyList(), anyString(), isNull());
}
use of org.neo4j.server.CommunityNeoWebServer in project neo4j by neo4j.
the class ThirdPartyJAXRSModuleTest method shouldReportThirdPartyPackagesAtSpecifiedMount.
@Test
void shouldReportThirdPartyPackagesAtSpecifiedMount() throws Exception {
// Given
WebServer webServer = mock(WebServer.class);
CommunityNeoWebServer neoServer = mock(CommunityNeoWebServer.class);
when(neoServer.getBaseUri()).thenReturn(new URI("http://localhost:7575"));
when(neoServer.getWebServer()).thenReturn(webServer);
Config config = mock(Config.class);
List<ThirdPartyJaxRsPackage> jaxRsPackages = new ArrayList<>();
String path = "/third/party/package";
jaxRsPackages.add(new ThirdPartyJaxRsPackage("org.example.neo4j", path));
when(config.get(ServerSettings.third_party_packages)).thenReturn(jaxRsPackages);
// When
ThirdPartyJAXRSModule module = new ThirdPartyJAXRSModule(webServer, config, NullLogProvider.getInstance());
module.start();
// Then
verify(webServer).addJAXRSPackages(any(List.class), anyString(), any());
}
Aggregations