public URI httpsURI() { if ( controls == null ) { throw new IllegalStateException( "Cannot access instance URI before or after the test runs." ); } return controls.httpsURI().orElseThrow( () -> new IllegalStateException( "HTTPS connector is not configured" ) ); }
private static URI getHttpsUriFromNeo4jRule( URI configuredHttpsUri ) throws Throwable { ServerControls serverControls = mock( ServerControls.class ); when( serverControls.httpsURI() ).thenReturn( Optional.ofNullable( configuredHttpsUri ) ); TestServerBuilder serverBuilder = mock( TestServerBuilder.class ); when( serverBuilder.newServer() ).thenReturn( serverControls ); Neo4jRule rule = new Neo4jRule( serverBuilder ); AtomicReference<URI> uriRef = new AtomicReference<>(); Statement statement = rule.apply( new Statement() { @Override public void evaluate() throws Throwable { uriRef.set( rule.httpsURI() ); } }, createTestDescription( Neo4jRuleTest.class, "test" ) ); statement.evaluate(); return uriRef.get(); } }
assertThat( HTTP.GET( server.httpsURI().get().toString() ).status(), equalTo( 200 ) ); assertDBConfig( server, "20", GraphDatabaseSettings.dense_node_threshold.name() );
public URI httpsURI() { if ( controls == null ) { throw new IllegalStateException( "Cannot access instance URI before or after the test runs." ); } return controls.httpsURI().orElseThrow( () -> new IllegalStateException( "HTTPS connector is not configured" ) ); }