@Test public void testSrcMatchToDstMatch() { Prefix p1 = Prefix.parse("1.1.1.1/24"); NatRuleMatch srcMatch = new NatRuleMatchSrcAddr(p1); assertThat( ReverseStaticNat.reverseMatchToMatch(srcMatch), equalTo(new NatRuleMatchDstAddr(p1))); String prefixName = "prefix"; srcMatch = new NatRuleMatchSrcAddrName(prefixName); assertThat( ReverseStaticNat.reverseMatchToMatch(srcMatch), equalTo(new NatRuleMatchDstAddrName(prefixName))); srcMatch = new NatRuleMatchSrcPort(10000, 30000); assertThat( ReverseStaticNat.reverseMatchToMatch(srcMatch), equalTo(new NatRuleMatchDstPort(10000, 30000))); srcMatch = new NatRuleMatchDstAddr(p1); assertNull(ReverseStaticNat.reverseMatchToMatch(srcMatch)); srcMatch = new NatRuleMatchDstAddrName(prefixName); assertNull(ReverseStaticNat.reverseMatchToMatch(srcMatch)); srcMatch = new NatRuleMatchDstPort(100, 200); assertNull(ReverseStaticNat.reverseMatchToMatch(srcMatch)); }
@VisibleForTesting static NatRuleMatch reverseMatchToMatch(NatRuleMatch match) { return match.accept(SRC_MATCH_TO_DST_MATCH); }
ReverseStaticNat { @VisibleForTesting static NatRuleMatch reverseMatchToMatch(NatRuleMatch match) { return match.accept(SRC_MATCH_TO_DST_MATCH); } }
ReverseStaticNat { @VisibleForTesting static NatRuleMatch reverseMatchToMatch(NatRuleMatch match) { return match.accept(SRC_MATCH_TO_DST_MATCH); }  }
ReverseStaticNat { @VisibleForTesting static NatRuleMatch reverseMatchToMatch(NatRuleMatch match) { return match.accept(SRC_MATCH_TO_DST_MATCH); }   }
ReverseStaticNat { @VisibleForTesting static NatRuleMatch reverseMatchToMatch(NatRuleMatch match) { return match.accept(SRC_MATCH_TO_DST_MATCH); }    }