@Test public void testConvertDoesntExtendsGatewaySecurityGroupsWithDefaultGatewayCidrsWithCCM() { ReflectionTestUtils.setField(underTest, "defaultGatewayCidr", Set.of("0.0.0.0/0", "1.1.1.1/1")); ReflectionTestUtils.setField(underTest, "nginxPort", 9443); underTest.extendGatewaySecurityGroupWithDefaultGatewayCidrs(stack, Tunnel.CCM); Set<InstanceGroup> gateways = stack.getInstanceGroups().stream().filter(ig -> InstanceGroupType.isGateway(ig.getInstanceGroupType())).collect(Collectors.toSet()); for (InstanceGroup ig : gateways) { assertNull(ig.getSecurityGroup()); } }
public void extendGatewaySecurityGroupWithDefaultGatewayCidrs(Stack stack, Tunnel tunnel) { Set<InstanceGroup> gateways = filterForGateways(stack); Set<String> defaultGatewayCidrs = filterEmptyCidrs(); LOGGER.debug("Extending security group for gateways: [{}] DefaultGatewayCidrs: [{}] Tunnel: [{}]", gateways.stream().map(InstanceGroup::getGroupName).collect(Collectors.joining(", ")), defaultGatewayCidrs, tunnel); if (!defaultGatewayCidrs.isEmpty() && !tunnel.useCcm()) { extendGatewaysSecurityGroupsWithRules(stack, gateways, defaultGatewayCidrs); } }
GatewaySecurityGroupDecorator { public void extendGatewaySecurityGroupWithDefaultGatewayCidrs(Stack stack, Tunnel tunnel) { Set<InstanceGroup> gateways = filterForGateways(stack); Set<String> defaultGatewayCidrs = filterEmptyCidrs(); LOGGER.debug("Extending security group for gateways: [{}] DefaultGatewayCidrs: [{}] Tunnel: [{}]", gateways.stream().map(InstanceGroup::getGroupName).collect(Collectors.joining(", ")), defaultGatewayCidrs, tunnel); if (!defaultGatewayCidrs.isEmpty() && !tunnel.useCcm()) { extendGatewaysSecurityGroupsWithRules(stack, gateways, defaultGatewayCidrs); } } }
GatewaySecurityGroupDecorator { public void extendGatewaySecurityGroupWithDefaultGatewayCidrs(Stack stack, Tunnel tunnel) { Set<InstanceGroup> gateways = filterForGateways(stack); Set<String> defaultGatewayCidrs = filterEmptyCidrs(); LOGGER.debug("Extending security group for gateways: [{}] DefaultGatewayCidrs: [{}] Tunnel: [{}]", gateways.stream().map(InstanceGroup::getGroupName).collect(Collectors.joining(", ")), defaultGatewayCidrs, tunnel); if (!defaultGatewayCidrs.isEmpty() && !tunnel.useCcm()) { extendGatewaysSecurityGroupsWithRules(stack, gateways, defaultGatewayCidrs); } }  }
GatewaySecurityGroupDecorator { public void extendGatewaySecurityGroupWithDefaultGatewayCidrs(Stack stack, Tunnel tunnel) { Set<InstanceGroup> gateways = filterForGateways(stack); Set<String> defaultGatewayCidrs = filterEmptyCidrs(); LOGGER.debug("Extending security group for gateways: [{}] DefaultGatewayCidrs: [{}] Tunnel: [{}]", gateways.stream().map(InstanceGroup::getGroupName).collect(Collectors.joining(", ")), defaultGatewayCidrs, tunnel); if (!defaultGatewayCidrs.isEmpty() && !tunnel.useCcm()) { extendGatewaysSecurityGroupsWithRules(stack, gateways, defaultGatewayCidrs); } }  void extendGatewaySecurityGroupWithDefaultGatewayCidrs(Stack stack, Tunnel tunnel); }
GatewaySecurityGroupDecorator { public void extendGatewaySecurityGroupWithDefaultGatewayCidrs(Stack stack, Tunnel tunnel) { Set<InstanceGroup> gateways = filterForGateways(stack); Set<String> defaultGatewayCidrs = filterEmptyCidrs(); LOGGER.debug("Extending security group for gateways: [{}] DefaultGatewayCidrs: [{}] Tunnel: [{}]", gateways.stream().map(InstanceGroup::getGroupName).collect(Collectors.joining(", ")), defaultGatewayCidrs, tunnel); if (!defaultGatewayCidrs.isEmpty() && !tunnel.useCcm()) { extendGatewaysSecurityGroupsWithRules(stack, gateways, defaultGatewayCidrs); } }  void extendGatewaySecurityGroupWithDefaultGatewayCidrs(Stack stack, Tunnel tunnel);  }