Subnet extends Resource { public com.amazonaws.services.ec2.model.Subnet firstRemoteSubnet() { return remoteSubnets.first(); } Subnet(String id); com.amazonaws.services.ec2.model.Subnet firstRemoteSubnet(); final SortedSet<com.amazonaws.services.ec2.model.Subnet> remoteSubnets; final List<String> cidrs; public SubnetType type; public VPC vpc; public RouteTable routeTable; }
@Test void firstRemoteSubnet() { Subnet subnet = new Subnet("public"); subnet.remoteSubnets.add(new com.amazonaws.services.ec2.model.Subnet().withSubnetId("1").withAvailabilityZone("us-east-1b")); subnet.remoteSubnets.add(new com.amazonaws.services.ec2.model.Subnet().withSubnetId("2").withAvailabilityZone("us-east-1a")); assertEquals("us-east-1a", subnet.firstRemoteSubnet().getAvailabilityZone()); }