@Test public void testResolveDestinationIpSpace_emptyDestIpSpace() throws InvalidReachabilityParametersException { ReachabilityParameters reachabilityParameters = ReachabilityParameters.builder() .setActions(ImmutableSortedSet.of(ACCEPTED)) .setFinalNodesSpecifier(AllNodesNodeSpecifier.INSTANCE) .setDestinationIpSpaceSpecifier(new ConstantIpSpaceSpecifier(EmptyIpSpace.INSTANCE)) .build(); exception.expect(InvalidReachabilityParametersException.class); exception.expectMessage("Empty destination IpSpace"); new ReachabilityParametersResolver(_batfish, reachabilityParameters, _snapshot) .resolveDestinationIpSpace(); }
@VisibleForTesting IpSpace resolveDestinationIpSpace() throws InvalidReachabilityParametersException { IpSpace destinationIpSpace = AclIpSpace.union( _params.getDestinationIpSpaceSpecifier().resolve(ImmutableSet.of(), _context) .getEntries().stream() .map(Entry::getIpSpace) .collect(ImmutableList.toImmutableList())); if (!_ipSpaceRepresentative.getRepresentative(destinationIpSpace).isPresent()) { throw new InvalidReachabilityParametersException("Empty destination IpSpace"); } return destinationIpSpace; }
ReachabilityParametersResolver { @VisibleForTesting IpSpace resolveDestinationIpSpace() throws InvalidReachabilityParametersException { IpSpace destinationIpSpace = AclIpSpace.union( _params.getDestinationIpSpaceSpecifier().resolve(ImmutableSet.of(), _context) .getEntries().stream() .map(Entry::getIpSpace) .collect(ImmutableList.toImmutableList())); if (!_ipSpaceRepresentative.getRepresentative(destinationIpSpace).isPresent()) { throw new InvalidReachabilityParametersException("Empty destination IpSpace"); } return destinationIpSpace; } }
ReachabilityParametersResolver { @VisibleForTesting IpSpace resolveDestinationIpSpace() throws InvalidReachabilityParametersException { IpSpace destinationIpSpace = AclIpSpace.union( _params.getDestinationIpSpaceSpecifier().resolve(ImmutableSet.of(), _context) .getEntries().stream() .map(Entry::getIpSpace) .collect(ImmutableList.toImmutableList())); if (!_ipSpaceRepresentative.getRepresentative(destinationIpSpace).isPresent()) { throw new InvalidReachabilityParametersException("Empty destination IpSpace"); } return destinationIpSpace; } @VisibleForTesting  ReachabilityParametersResolver(
      IBatfish batfish, ReachabilityParameters params, NetworkSnapshot snapshot); }
ReachabilityParametersResolver { @VisibleForTesting IpSpace resolveDestinationIpSpace() throws InvalidReachabilityParametersException { IpSpace destinationIpSpace = AclIpSpace.union( _params.getDestinationIpSpaceSpecifier().resolve(ImmutableSet.of(), _context) .getEntries().stream() .map(Entry::getIpSpace) .collect(ImmutableList.toImmutableList())); if (!_ipSpaceRepresentative.getRepresentative(destinationIpSpace).isPresent()) { throw new InvalidReachabilityParametersException("Empty destination IpSpace"); } return destinationIpSpace; } @VisibleForTesting  ReachabilityParametersResolver(
      IBatfish batfish, ReachabilityParameters params, NetworkSnapshot snapshot); static ResolvedReachabilityParameters resolveReachabilityParameters(
      IBatfish batfish, ReachabilityParameters params, NetworkSnapshot snapshot); }
ReachabilityParametersResolver { @VisibleForTesting IpSpace resolveDestinationIpSpace() throws InvalidReachabilityParametersException { IpSpace destinationIpSpace = AclIpSpace.union( _params.getDestinationIpSpaceSpecifier().resolve(ImmutableSet.of(), _context) .getEntries().stream() .map(Entry::getIpSpace) .collect(ImmutableList.toImmutableList())); if (!_ipSpaceRepresentative.getRepresentative(destinationIpSpace).isPresent()) { throw new InvalidReachabilityParametersException("Empty destination IpSpace"); } return destinationIpSpace; } @VisibleForTesting  ReachabilityParametersResolver(
      IBatfish batfish, ReachabilityParameters params, NetworkSnapshot snapshot); static ResolvedReachabilityParameters resolveReachabilityParameters(
      IBatfish batfish, ReachabilityParameters params, NetworkSnapshot snapshot);  }