### Question:
AwsNetworkView { public List<String> getExistingVpcCidrs() { List<String> cidrs = network.getParameter(VPC_CIDRS, List.class); if (cidrs == null || cidrs.isEmpty()) { return List.of(getExistingVpcCidr()); } return cidrs; } AwsNetworkView(Network network); boolean isExistingVPC(); boolean isExistingSubnet(); boolean isExistingIGW(); String getExistingSubnet(); boolean isSubnetList(); List<String> getSubnetList(); String getExistingIgw(); String getExistingVpc(); String getExistingVpcCidr(); List<String> getExistingVpcCidrs(); static final String VPC_ID; static final String REGION; }### Answer:
@Test public void testMultipleSubnetCidr() { when(network.getParameter(VPC_CIDRS, List.class)).thenReturn(List.of("1.1.1.1", "2.2.2.2")); assertTrue(underTest.getExistingVpcCidrs().containsAll(List.of("1.1.1.1", "2.2.2.2"))); }
@Test public void testMultipleSubnetCidrNull() { when(network.getParameter(VPC_CIDRS, List.class)).thenReturn(null); when(network.getStringParameter(VPC_CIDR)).thenReturn("1.1.1.1"); assertTrue(underTest.getExistingVpcCidrs().contains("1.1.1.1")); }
@Test public void testMultipleSubnetCidrEmpty() { when(network.getParameter(VPC_CIDRS, List.class)).thenReturn(List.of()); when(network.getStringParameter(VPC_CIDR)).thenReturn("1.1.1.1"); assertTrue(underTest.getExistingVpcCidrs().contains("1.1.1.1")); }