pnc-mock/src/main/java/org/jboss/pnc/mock/executor/BuildExecutorMock.java
@Override
    public BuildExecutionSession startBuilding(
            BuildExecutionConfiguration buildExecutionConfiguration,
            Consumer<BuildExecutionStatusChangedEvent> onBuildExecutionStatusChangedEvent,
            String accessToken)
            throws ExecutorException {

        log.info("Starting mock build execution for buildExecutionConfiguration.id {}", buildExecutionConfiguration.getId());

        BuildExecutionSession buildExecutionSession = new BuildExecutionSessionMock(buildExecutionConfiguration, onBuildExecutionStatusChangedEvent);
        buildExecutionSession.setStatus(BuildExecutionStatus.NEW);

        runningExecutions.put(buildExecutionConfiguration.getId(), buildExecutionSession);
        Consumer<BuildExecutionStatus> onCompleteInternal = (buildStatus) -> {
            log.debug("Removing buildExecutionConfiguration.id [" + buildExecutionConfiguration.getId() + "] form list of running tasks.");
            runningExecutions.remove(buildExecutionConfiguration.getId());
            buildExecutionSession.setStatus(buildStatus);
        }
@Override
    public BuildExecutionSession startBuilding(
            BuildExecutionConfiguration buildExecutionConfiguration,
            Consumer<BuildExecutionStatusChangedEvent> onBuildExecutionStatusChangedEvent,
            String accessToken)
            throws ExecutorException {

        log.info("Starting mock build execution for buildExecutionConfiguration.id {}", buildExecutionConfiguration.getId());

        BuildExecutionSession buildExecutionSession = new BuildExecutionSessionMock(buildExecutionConfiguration, onBuildExecutionStatusChangedEvent);
        buildExecutionSession.setStatus(BuildExecutionStatus.NEW);

        runningExecutions.put(buildExecutionConfiguration.getId(), buildExecutionSession);
        Consumer<BuildExecutionStatus> onCompleteInternal = (buildStatus) -> {
            log.debug("Removing buildExecutionConfiguration.id [" + buildExecutionConfiguration.getId() + "] form list of running tasks.");
            runningExecutions.remove(buildExecutionConfiguration.getId());
            buildExecutionSession.setStatus(buildStatus);
        }
@ Override public BuildExecutionSession startBuilding ( BuildExecutionConfiguration buildExecutionConfiguration , Consumer < BuildExecutionStatusChangedEvent > onBuildExecutionStatusChangedEvent , String accessToken ) throws ExecutorException { log . info ( "Starting mock build execution for buildExecutionConfiguration.id {}" , buildExecutionConfiguration . getId ( ) ) ; BuildExecutionSession buildExecutionSession = new BuildExecutionSessionMock ( buildExecutionConfiguration , onBuildExecutionStatusChangedEvent ) ; buildExecutionSession . setStatus ( BuildExecutionStatus . NEW ) ; runningExecutions . put ( buildExecutionConfiguration . getId ( ) , buildExecutionSession ) ; Consumer < BuildExecutionStatus > onCompleteInternal = ( buildStatus ) - > { log . debug ( "Removing buildExecutionConfiguration.id [" + buildExecutionConfiguration . getId ( ) + "] form list of running tasks." ) ; runningExecutions . remove ( buildExecutionConfiguration . getId ( ) ) ; buildExecutionSession . setStatus ( buildStatus ) ; }
}
}