private void verifyLocalBuildConfigExecutorWasInvoked(KieModule module, ResourceChangeRequest... changes) { verify(localBuildConfigExecutor, times(1)).apply(localModuleCaptor.capture(), localBuildConfigCaptor.capture()); assertEquals(module, localModuleCaptor.getValue().getModule()); assertEquals(LocalBuildConfig.BuildType.INCREMENTAL_BATCH_CHANGES.name(), localBuildConfigCaptor.getValue().getBuildType()); for (ResourceChangeRequest change : changes) { assertNotNull(localBuildConfigCaptor.getValue().getResourceChanges().get(LocalBuildConfig.RESOURCE_CHANGE + change.getUri())); assertEquals(change.getChanges(), localBuildConfigCaptor.getValue().getResourceChanges().get(LocalBuildConfig.RESOURCE_CHANGE + change.getUri())); } }
public static Map< Path, Collection< ResourceChange > > createResourceChanges( BuildPipelineTestBase.ResourceChangeRequest ... changes ) { Map< Path, Collection< ResourceChange > > resourceChanges = new HashMap<>( ); for ( BuildPipelineTestBase.ResourceChangeRequest change : changes ) { Path resource = Paths.convert( org.uberfire.java.nio.file.Paths.get( change.getUri() ) ); resourceChanges.put( resource, createChanges( change.getChanges() ) ); } return resourceChanges; }
/** * @return the Pipeline input for a set of batch changes. */ public static Input createBatchChangesInput( String rootPathUri, String buildType, ResourceChangeRequest ... changes ) { Input input = new Input(); input.put( LocalSourceConfig.ROOT_PATH, rootPathUri ); input.put( LocalBuildConfig.BUILD_TYPE, buildType ); for ( ResourceChangeRequest change : changes ) { input.put( LocalBuildConfig.RESOURCE_CHANGE + change.getUri(), change.getChanges() ); } return input; }