@Test public void testWithValidIgw() { DescribeRouteTablesResult describeRouteTablesResult = new DescribeRouteTablesResult(); RouteTable routeTable = new RouteTable(); Route route = new Route(); route.setGatewayId(GATEWAY_ID); route.setDestinationCidrBlock(OPEN_CIDR_BLOCK); routeTable.setRoutes(List.of(route)); RouteTableAssociation routeTableAssociation = new RouteTableAssociation(); routeTableAssociation.setSubnetId(SUBNET_ID); routeTable.setAssociations(List.of(routeTableAssociation)); describeRouteTablesResult.setRouteTables(List.of(routeTable)); boolean hasInternetGateway = awsSubnetIgwExplorer.hasInternetGatewayOfSubnet(describeRouteTablesResult, SUBNET_ID); assertTrue(hasInternetGateway); }
public boolean hasInternetGatewayOfSubnet(DescribeRouteTablesResult describeRouteTablesResult, String subnetId) { Optional<RouteTable> routeTable = getRouteTableForSubnet(describeRouteTablesResult, subnetId); return hasInternetGateway(routeTable, subnetId); }
AwsSubnetIgwExplorer { public boolean hasInternetGatewayOfSubnet(DescribeRouteTablesResult describeRouteTablesResult, String subnetId) { Optional<RouteTable> routeTable = getRouteTableForSubnet(describeRouteTablesResult, subnetId); return hasInternetGateway(routeTable, subnetId); } }
AwsSubnetIgwExplorer { public boolean hasInternetGatewayOfSubnet(DescribeRouteTablesResult describeRouteTablesResult, String subnetId) { Optional<RouteTable> routeTable = getRouteTableForSubnet(describeRouteTablesResult, subnetId); return hasInternetGateway(routeTable, subnetId); }  }
AwsSubnetIgwExplorer { public boolean hasInternetGatewayOfSubnet(DescribeRouteTablesResult describeRouteTablesResult, String subnetId) { Optional<RouteTable> routeTable = getRouteTableForSubnet(describeRouteTablesResult, subnetId); return hasInternetGateway(routeTable, subnetId); }  boolean hasInternetGatewayOfSubnet(DescribeRouteTablesResult describeRouteTablesResult, String subnetId); }
AwsSubnetIgwExplorer { public boolean hasInternetGatewayOfSubnet(DescribeRouteTablesResult describeRouteTablesResult, String subnetId) { Optional<RouteTable> routeTable = getRouteTableForSubnet(describeRouteTablesResult, subnetId); return hasInternetGateway(routeTable, subnetId); }  boolean hasInternetGatewayOfSubnet(DescribeRouteTablesResult describeRouteTablesResult, String subnetId);  }