@Test public void shouldExposeWebHooksVia3scaleWhen3scaleIsEnabled() { final OpenShiftConfigurationProperties properties = new OpenShiftConfigurationProperties(); properties.setManagementUrlFor3scale("https: final ExposureDeploymentDataCustomizer customizer = new ExposureDeploymentDataCustomizer(new ExposureHelper(properties)); final IntegrationDeployment webHookIntegration = new IntegrationDeployment.Builder() .spec(new Integration.Builder() .addFlow(new Flow.Builder().addStep(new Step.Builder().action(new ConnectorAction.Builder() .descriptor(new ConnectorDescriptor.Builder().connectorId("webhook").build()).addTag("expose") .build()).build()).build()) .build()) .build(); assertThat(customizer.determineExposure(webHookIntegration)).containsOnly(Exposure.SERVICE, Exposure._3SCALE); }
EnumSet<Exposure> determineExposure(final IntegrationDeployment integrationDeployment) { if (integrationDeployment.getSpec().isExposable()) { return exposureHelper.determineExposure(integrationDeployment.getSpec().getExposure()); } return EnumSet.noneOf(Exposure.class); }
ExposureDeploymentDataCustomizer implements DeploymentDataCustomizer { EnumSet<Exposure> determineExposure(final IntegrationDeployment integrationDeployment) { if (integrationDeployment.getSpec().isExposable()) { return exposureHelper.determineExposure(integrationDeployment.getSpec().getExposure()); } return EnumSet.noneOf(Exposure.class); } }
ExposureDeploymentDataCustomizer implements DeploymentDataCustomizer { EnumSet<Exposure> determineExposure(final IntegrationDeployment integrationDeployment) { if (integrationDeployment.getSpec().isExposable()) { return exposureHelper.determineExposure(integrationDeployment.getSpec().getExposure()); } return EnumSet.noneOf(Exposure.class); } ExposureDeploymentDataCustomizer(ExposureHelper exposureHelper); }
ExposureDeploymentDataCustomizer implements DeploymentDataCustomizer { EnumSet<Exposure> determineExposure(final IntegrationDeployment integrationDeployment) { if (integrationDeployment.getSpec().isExposable()) { return exposureHelper.determineExposure(integrationDeployment.getSpec().getExposure()); } return EnumSet.noneOf(Exposure.class); } ExposureDeploymentDataCustomizer(ExposureHelper exposureHelper); @Override DeploymentData customize(final DeploymentData data, final IntegrationDeployment integrationDeployment); }
ExposureDeploymentDataCustomizer implements DeploymentDataCustomizer { EnumSet<Exposure> determineExposure(final IntegrationDeployment integrationDeployment) { if (integrationDeployment.getSpec().isExposable()) { return exposureHelper.determineExposure(integrationDeployment.getSpec().getExposure()); } return EnumSet.noneOf(Exposure.class); } ExposureDeploymentDataCustomizer(ExposureHelper exposureHelper); @Override DeploymentData customize(final DeploymentData data, final IntegrationDeployment integrationDeployment);  }