RegionAdaptationContext { void updateRegionMetrics ( final List<PipelineMetrics> metrics, final BiPredicate<PipelineMetrics, PipelineMetrics> loadChangePredicate ) { checkArgument( metrics != null ); checkArgument( loadChangePredicate != null ); checkState( adaptationActions.isEmpty(), "Region metrics cannot be updated while region %s has ongoing adaptations: %s", getRegionId(), adaptationActions ); for ( PipelineMetrics pipelineMetrics : metrics ) { updatePipelineMetrics( pipelineMetrics, loadChangePredicate ); } } RegionAdaptationContext( final RegionExecPlan currentExecPlan ); int getRegionId(); RegionDef getRegionDef();  }
@Test( expected = IllegalArgumentException.class ) public void shouldNotUpdatePipelineMetricsWithInvalidPipelineId () { final PipelineMetrics pipelineMetrics = mock( PipelineMetrics.class ); when( pipelineMetrics.getPipelineId() ).thenReturn( pipelineId1 ); context.updateRegionMetrics( singletonList( pipelineMetrics ), loadChangePredicate ); }