/** * Execute the given function with the {@link #getServer()} value and {@link #getBaseURI()} * as its parameters. * * @param <R> function return type * @param function the function * @return the result of executing the function */ default <R> R query(BiFunction<T, URI, R> function) { return function.apply(getServer().getValue(), getBaseURI()); }
/** * Execute the given consumer function with the {@link #getServer()} value and * {@link #getBaseURI()} as its parameters. * * @param consumer the consumer function */ default void command(BiConsumer<T, URI> consumer) { consumer.accept(getServer().getValue(), getBaseURI()); }
void createServer(TestContext testContext, TestConfigurer testConfigurer, ServerProvider serverProvider, Application application) throws Exception { //configure and start the server Object serverConfig = serverProvider.configure(testContext); serverConfig = testConfigurer.configure(testContext, serverConfig); ServerInstance serverInstance = serverProvider.start(testContext, application, serverConfig); testContext .addProperty(TestContextProperties.SERVER_INSTANCE, serverInstance) .addProperty(serverInstance.getFqn(), serverInstance.getProperties()) .addProperty(TestContextProperties.SERVER_BASE_URI, serverInstance.getBaseURI()) .addProperty(TestContextProperties.SERVER, serverInstance .getServer().getValue()); }