### Question:
CloudRegionOrchestrationValidator implements PreBuildingBlockValidator { @Override public Optional<String> validate(BuildingBlockExecution execution) { String msg = null; try { CloudRegion cloudRegion = execution.getGeneralBuildingBlock().getCloudRegion(); if (Boolean.TRUE.equals(cloudRegion.getOrchestrationDisabled())) { msg = String.format( "Error: The request has failed due to orchestration currently disabled for the target cloud region %s for cloud owner %s", cloudRegion.getLcpCloudRegionId(), cloudRegion.getCloudOwner()); logger.error(msg); return Optional.ofNullable(msg); } } catch (Exception e) { logger.error("failed to validate", e); exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e, ONAPComponents.SO); } return Optional.empty(); }  @Override boolean shouldRunFor(String bbName); @Override Optional<String> validate(BuildingBlockExecution execution);  }### Answer:
@Test public void validateDisabledTest() { cloudRegion.setOrchestrationDisabled(true); CloudRegionOrchestrationValidator validation = new CloudRegionOrchestrationValidator(); Optional<String> result = validation.validate(mockExecution); assertEquals( "Error: The request has failed due to orchestration currently disabled for the target cloud region my-region-id for cloud owner CloudOwner", result.get()); }
@Test public void validateNotDisabledTest() { cloudRegion.setOrchestrationDisabled(false); CloudRegionOrchestrationValidator validation = new CloudRegionOrchestrationValidator(); Optional<String> result = validation.validate(mockExecution); assertFalse(result.isPresent()); }
@Test public void validateDisabledIsNullTest() { CloudRegionOrchestrationValidator validation = new CloudRegionOrchestrationValidator(); Optional<String> result = validation.validate(mockExecution); assertFalse(result.isPresent()); }