/** * Define a function to be applied * * @param function function */ public void withFunction(Function<P, R> function) { withBiFunction((s, p) -> function.apply(p)); } }
@Inject private void configureTestDetectionHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName(Constants.TESTING_RPC_TEST_DETECTION_NAME) .paramsAsDto(TestDetectionContext.class) .resultAsDto(TestDetectionResult.class) .withBiFunction(this::handleTestDetection); }
@Inject private void configureRunTestHandler(RequestHandlerConfigurator configurator) { configurator .newConfiguration() .methodName(Constants.RUN_TESTS_METHOD) .paramsAsDto(TestExecutionContext.class) .resultAsDto(TestLaunchResult.class) .withBiFunction(this::runTests); }