Search in sources :

Example 6 with WebServer

use of org.neo4j.server.web.WebServer in project neo4j by neo4j.

the class TransactionModuleTest method shouldRegisterASingleUri.

@SuppressWarnings("unchecked")
@Test
public void shouldRegisterASingleUri() {
    // Given
    WebServer webServer = mock(WebServer.class);
    Config config = Config.defaults(ServerSettings.db_api_path, URI.create("/db/data"));
    // When
    TransactionModule module = new TransactionModule(webServer, config);
    module.start();
    // Then
    ArgumentCaptor<List<Class<?>>> captor = ArgumentCaptor.forClass(List.class);
    verify(webServer).addJAXRSClasses(captor.capture(), anyString(), any());
    assertThat(captor.getValue()).isNotEmpty();
}
Also used : WebServer(org.neo4j.server.web.WebServer) Config(org.neo4j.configuration.Config) List(java.util.List) Test(org.junit.jupiter.api.Test)

Aggregations

WebServer (org.neo4j.server.web.WebServer)6 List (java.util.List)5 URI (java.net.URI)4 Test (org.junit.Test)3 Test (org.junit.jupiter.api.Test)3 Matchers.anyString (org.mockito.Matchers.anyString)3 Config (org.neo4j.configuration.Config)3 Config (org.neo4j.kernel.configuration.Config)3 HashMap (java.util.HashMap)2 CommunityNeoServer (org.neo4j.server.CommunityNeoServer)2 CommunityNeoWebServer (org.neo4j.server.CommunityNeoWebServer)2 ArrayList (java.util.ArrayList)1 Description (org.hamcrest.Description)1 ArgumentMatcher (org.mockito.ArgumentMatcher)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1 Matchers.anyList (org.mockito.Matchers.anyList)1 Dependencies (org.neo4j.kernel.impl.util.Dependencies)1 ThirdPartyJaxRsPackage (org.neo4j.server.configuration.ThirdPartyJaxRsPackage)1 Database (org.neo4j.server.database.Database)1 UserService (org.neo4j.server.rest.dbms.UserService)1