コード例 #1
0
ファイル: RESTApiModuleTest.java プロジェクト: jakewins/neo4j
  @Test
  public void shouldRegisterASingleUri() throws Exception {
    WebServer webServer = mock(WebServer.class);

    Configuration config = new PropertiesConfiguration();
    String path = "/db/data";
    config.addProperty(Configurator.REST_API_PATH_PROPERTY_KEY, path);

    Database db = mock(Database.class);

    RESTApiModule module = new RESTApiModule(webServer, db, config);
    module.start(StringLogger.DEV_NULL);

    verify(webServer).addJAXRSClasses(any(List.class), anyString(), anyCollection());
  }
コード例 #2
0
  @Test
  public void shouldRegisterASingleUri() throws Exception {
    WebServer webServer = mock(WebServer.class);

    NeoServerWithEmbeddedWebServer neoServer = mock(NeoServerWithEmbeddedWebServer.class);
    when(neoServer.baseUri()).thenReturn(new URI("http://localhost:7575"));
    when(neoServer.getWebServer()).thenReturn(webServer);

    Configuration config = new PropertiesConfiguration();
    String path = "/db/data";
    config.addProperty(Configurator.REST_API_PATH_PROPERTY_KEY, path);

    when(neoServer.getConfiguration()).thenReturn(config);

    RESTApiModule module = new RESTApiModule();
    module.start(neoServer, null);

    verify(webServer).addJAXRSPackages(any(List.class), anyString());
  }