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()); }
void createClient(TestContext testContext, TestConfigurer testConfigurer, ClientProvider clientProvider, Application application) { URI baseURI = testContext.getProperty(TestContextProperties.SERVER_BASE_URI); //configure and create the client Object clientConfig = clientProvider.configure(testContext, application, baseURI); clientConfig = testConfigurer.configure(testContext, clientConfig); ClientInstance<Object, Object> clientInstance = clientProvider.create(testContext, application, baseURI, clientConfig); testContext .addProperty(TestContextProperties.CLIENT_INSTANCE, clientInstance) .addProperty(clientInstance.getFqn(), clientInstance.getProperties()) .addProperty(TestContextProperties.CLIENT, clientInstance .getClient().getValue()); clientInstance.getClientSupplier() .map(Instance::getValue) .ifPresent(value -> { testContext.addProperty(TestContextProperties.CLIENT_SUPPLIER, value); }); }