@Test public void testJsonSerialization() { RoutingStepDetail routingStepDetail = RoutingStepDetail.builder() .setRoutes( ImmutableList.of( new RouteInfo(RoutingProtocol.BGP, Prefix.parse("1.1.1.1/30"), null, null), new RouteInfo(RoutingProtocol.STATIC, Prefix.parse("2.1.1.3/30"), null, null))) .setOutputInterface("iface") .setArpIp(Ip.parse("2.3.4.5")) .build(); RoutingStep routingStep = RoutingStep.builder() .setAction(StepAction.FORWARDED_TO_NEXT_VRF) .setDetail(routingStepDetail) .build(); RoutingStep routingStepCloned = BatfishObjectMapper.clone(routingStep, RoutingStep.class); assertThat( routingStepCloned.getDetail().getRoutes(), equalTo( ImmutableList.of( new RouteInfo(RoutingProtocol.BGP, Prefix.parse("1.1.1.1/30"), null, null), new RouteInfo(RoutingProtocol.STATIC, Prefix.parse("2.1.1.3/30"), null, null)))); assertThat(routingStepCloned.getDetail().getArpIp(), equalTo(Ip.parse("2.3.4.5"))); assertThat(routingStepCloned.getDetail().getOutputInterface(), equalTo("iface")); assertThat(routingStep.getAction(), equalTo(StepAction.FORWARDED_TO_NEXT_VRF)); }
public static Builder builder() { return new Builder(); }
RoutingStep extends Step<RoutingStepDetail> { public static Builder builder() { return new Builder(); } }
RoutingStep extends Step<RoutingStepDetail> { public static Builder builder() { return new Builder(); } private  RoutingStep(RoutingStepDetail detail, StepAction action); }
RoutingStep extends Step<RoutingStepDetail> { public static Builder builder() { return new Builder(); } private  RoutingStep(RoutingStepDetail detail, StepAction action); static Builder builder(); }
RoutingStep extends Step<RoutingStepDetail> { public static Builder builder() { return new Builder(); } private  RoutingStep(RoutingStepDetail detail, StepAction action); static Builder builder();  }