Search in sources :

Example 1 with RouteTarget

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);
    }
}
Also used : L3Network(org.onap.aai.domain.yang.L3Network) VpnBinding(org.onap.aai.domain.yang.VpnBinding) AAIResourceUri(org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri) RouteTargets(org.onap.aai.domain.yang.RouteTargets) RouteTarget(org.onap.aai.domain.yang.RouteTarget) File(java.io.File) AAIResultWrapper(org.onap.aaiclient.client.aai.entities.AAIResultWrapper) BaseTaskTest(org.onap.so.bpmn.BaseTaskTest) Test(org.junit.Test)

Aggregations

File (java.io.File)1 Test (org.junit.Test)1 L3Network (org.onap.aai.domain.yang.L3Network)1 RouteTarget (org.onap.aai.domain.yang.RouteTarget)1 RouteTargets (org.onap.aai.domain.yang.RouteTargets)1 VpnBinding (org.onap.aai.domain.yang.VpnBinding)1 AAIResultWrapper (org.onap.aaiclient.client.aai.entities.AAIResultWrapper)1 AAIResourceUri (org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri)1 BaseTaskTest (org.onap.so.bpmn.BaseTaskTest)1