use of org.onap.aai.domain.yang.RouteTarget in project so by onap.
the class VrfValidationTest method testAaiRouteTargetValidation.
@Test
public void testAaiRouteTargetValidation() throws VrfBondingServiceException, JsonParseException, JsonMappingException, IOException {
L3Network l3Network = mapper.readValue(new File("src/test/resources/__files/BuildingBlocks/aaiNetworkWrapper.json"), L3Network.class);
AAIResultWrapper networkWrapper = new AAIResultWrapper(l3Network);
if (networkWrapper.getRelationships().isPresent()) {
List<AAIResourceUri> vpnBindingUris = networkWrapper.getRelationships().get().getRelatedUris(Types.VPN_BINDING);
VpnBinding vpnBinding = new VpnBinding();
vpnBinding.setRouteTargets(new RouteTargets());
vpnBinding.getRouteTargets().getRouteTarget().add(new RouteTarget());
AAIResultWrapper wrapper = Mockito.mock(AAIResultWrapper.class);
doReturn(wrapper).when(bbSetupUtils).getAAIResourceDepthOne(vpnBindingUris.get(0));
doReturn(Optional.of(vpnBinding)).when(wrapper).asBean(VpnBinding.class);
ExpectedException.none();
vrfValidation.aaiRouteTargetValidation(l3Network);
}
}
Aggregations