### Question:
BuildPipelineInvoker { public void invokeLocalBuildPipeLine(LocalBuildRequest buildRequest, Consumer<LocalBinaryConfig> consumer) { Pipeline pipe = pipelineRegistry.getPipelineByName(BuildPipelineInitializer.LOCAL_BUILD_PIPELINE); Input input = new Input() { { put(LocalSourceConfig.ROOT_PATH, buildRequest.getModule().getRootPath().toURI()); put(LocalBuildConfig.BUILD_TYPE, buildRequest.getBuildType().name()); if (buildRequest.isSingleResource()) { put(LocalBuildConfig.RESOURCE, encodePath(buildRequest.getResource())); } else { addResourceChanges(this, buildRequest.getResourceChanges()); } if (buildRequest.getDeploymentType() != null) { put(LocalBuildConfig.DEPLOYMENT_TYPE, buildRequest.getDeploymentType().name()); put(LocalBuildConfig.SUPPRESS_HANDLERS, Boolean.toString(buildRequest.isSuppressHandlers())); } } }; executor.execute(input, pipe, consumer); } BuildPipelineInvoker(); @Inject  BuildPipelineInvoker(@Named("buildPipelineExecutor") final PipelineExecutor executor,
                                final PipelineRegistry pipelineRegistry); void invokeLocalBuildPipeLine(LocalBuildRequest buildRequest,
                                         Consumer<LocalBinaryConfig> consumer); LocalBinaryConfig invokeLocalBuildPipeLine(LocalBuildRequest buildRequest);  }### Answer:
@Test public void testFullBuildRequest() { when(buildRequest.getBuildType()).thenReturn(LocalBuildConfig.BuildType.FULL_BUILD); input = createFullBuildInput(ROOT_PATH_URI); preparePipeline(input); LocalBinaryConfig result = pipelineInvoker.invokeLocalBuildPipeLine(buildRequest); verifyPipelineInvocation(localBinaryConfig, result); }
@Test public void testIncrementalBuildResourceChanges() { Map<Path, Collection<ResourceChange>> resourceChanges = createResourceChanges(changes); when(buildRequest.getBuildType()).thenReturn(LocalBuildConfig.BuildType.INCREMENTAL_BATCH_CHANGES); when(buildRequest.isSingleResource()).thenReturn(false); when(buildRequest.getResourceChanges()).thenReturn(resourceChanges); input = createBatchChangesInput(ROOT_PATH_URI, LocalBuildConfig.BuildType.INCREMENTAL_BATCH_CHANGES.name(), changes); preparePipeline(input); LocalBinaryConfig result = pipelineInvoker.invokeLocalBuildPipeLine(buildRequest); verifyPipelineInvocation(localBinaryConfig, result); }