934538e67fff76040d7aab4a4a55b21196e198a6
[genius.git] / itm / itm-impl / src / test / java / org / opendaylight / genius / itm / tests / xtend / ExpectedDefTransportZoneObjects.xtend
1 /*
2  * Copyright (c) 2017 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.genius.itm.tests.xtend;
9
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.TransportZoneBuilder;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.VtepsBuilder;
12 import org.opendaylight.genius.itm.globals.ITMConstants;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeVxlan;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeGre;
15 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
16 import org.opendaylight.genius.itm.tests.ItmTestConstants;
17
18 import static extension org.opendaylight.mdsal.binding.testutils.XtendBuilderExtensions.operator_doubleGreaterThan
19
20 class ExpectedDefTransportZoneObjects {
21
22     static def newDefTzWithVxlanTunnelType() {
23         new TransportZoneBuilder >> [
24             zoneName = ITMConstants.DEFAULT_TRANSPORT_ZONE
25             tunnelType = TunnelTypeVxlan
26         ]
27     }
28
29     static def newDefTzWithGreTunnelType() {
30         new TransportZoneBuilder >> [
31             zoneName = ITMConstants.DEFAULT_TRANSPORT_ZONE
32             tunnelType = TunnelTypeGre
33         ]
34     }
35
36     static def newDefTzWithTep() {
37         new TransportZoneBuilder >> [
38             zoneName = ITMConstants.DEFAULT_TRANSPORT_ZONE
39             tunnelType = TunnelTypeVxlan
40             vteps = #[
41                 new VtepsBuilder >> [
42                     dpnId = ItmTestConstants.INT_DEF_BR_DPID
43                     ipAddress = IpAddressBuilder.getDefaultInstance(ItmTestConstants.DEF_TZ_TEP_IP)
44                     optionOfTunnel = false
45                 ]
46             ]
47
48         ]
49     }
50
51     static def defTzWithUpdatedTepIp() {
52         new TransportZoneBuilder >> [
53             zoneName = ITMConstants.DEFAULT_TRANSPORT_ZONE
54             tunnelType = TunnelTypeVxlan
55             vteps = #[
56                     new VtepsBuilder >> [
57                         dpnId = ItmTestConstants.INT_DEF_BR_DPID
58                         ipAddress = IpAddressBuilder.getDefaultInstance(ItmTestConstants.NB_TZ_TEP_IP)
59                         optionOfTunnel = false
60                     ]
61             ]
62         ]
63     }
64 }