}
private List<ProtocolEntry> createMdsalProtocols() {
- List<ProtocolEntry> protocolList = new ArrayList<ProtocolEntry>();
+ List<ProtocolEntry> protocolList = new ArrayList<>();
ImmutableBiMap<String, Class<? extends OvsdbBridgeProtocolBase>> mapper =
SouthboundConstants.OVSDB_PROTOCOL_MAP.inverse();
protocolList.add(new ProtocolEntryBuilder().
}
public static Set<String> createOvsdbBridgeProtocols(OvsdbBridgeAugmentation ovsdbBridgeNode) {
- Set<String> protocols = new HashSet<String>();
+ Set<String> protocols = new HashSet<>();
if (ovsdbBridgeNode.getProtocolEntry() != null && ovsdbBridgeNode.getProtocolEntry().size() > 0) {
for (ProtocolEntry protocol : ovsdbBridgeNode.getProtocolEntry()) {
if (SouthboundConstants.OVSDB_PROTOCOL_MAP.get(protocol.getProtocol()) != null) {
public class ConfigActivator implements BundleActivator {
private static final Logger LOG = LoggerFactory.getLogger(ConfigActivator.class);
- private List<ServiceRegistration<?>> registrations = new ArrayList<ServiceRegistration<?>>();
+ private List<ServiceRegistration<?>> registrations = new ArrayList<>();
private ProviderContext providerContext;
private ServiceTracker NetworkingProviderManagerTracker;
public Arp() {
payload = null;
- hdrFieldsMap = new HashMap<String, byte[]>(ARP_FIELDS_COUNT);
+ hdrFieldsMap = new HashMap<>(ARP_FIELDS_COUNT);
setHardwareLength((short) 6); // MAC address length
setProtocolLength((short) 4); // IPv4 address length
setHardwareType(ETHERNET_HW_TYPE);
private Neutron_IPs neutron_ip_src;
private Neutron_IPs neutron_ip_dest_1;
private Neutron_IPs neutron_ip_dest_2;
- private List<Neutron_IPs> neutronSrcIpList = new ArrayList<Neutron_IPs>();
- private List<Neutron_IPs> neutronDestIpList = new ArrayList<Neutron_IPs>();
+ private List<Neutron_IPs> neutronSrcIpList = new ArrayList<>();
+ private List<Neutron_IPs> neutronDestIpList = new ArrayList<>();
private static final String HOST_ADDRESS = "127.0.0.1/32";
private static final String MAC_ADDRESS = "87:1D:5E:02:40:B7";
private static final String SRC_IP = "192.168.0.1";
when(portSecurityRule.getSecurityRuleEthertype()).thenReturn("IPv4");
when(portSecurityRule.getSecurityRuleDirection()).thenReturn("egress");
- List<NeutronSecurityRule> portSecurityList = new ArrayList<NeutronSecurityRule>();
+ List<NeutronSecurityRule> portSecurityList = new ArrayList<>();
portSecurityList.add(portSecurityRule);
neutron_ip_src = new Neutron_IPs();
@Mock private NeutronSecurityRule portSecurityRule;
@Mock private SecurityServicesManager securityServices;
- private List<Neutron_IPs> neutronSrcIpList = new ArrayList<Neutron_IPs>();
- private List<Neutron_IPs> neutronDestIpList = new ArrayList<Neutron_IPs>();
+ private List<Neutron_IPs> neutronSrcIpList = new ArrayList<>();
+ private List<Neutron_IPs> neutronDestIpList = new ArrayList<>();
private Neutron_IPs neutron_ip_src;
private Neutron_IPs neutron_ip_dest_1;
private Neutron_IPs neutron_ip_dest_2;
when(portSecurityRule.getSecurityRuleEthertype()).thenReturn("IPv4");
when(portSecurityRule.getSecurityRuleDirection()).thenReturn("ingress");
- List<NeutronSecurityRule> portSecurityList = new ArrayList<NeutronSecurityRule>();
+ List<NeutronSecurityRule> portSecurityList = new ArrayList<>();
portSecurityList.add(portSecurityRule);
neutron_ip_src = new Neutron_IPs();
public class ConfigActivator implements BundleActivator {
private static final Logger LOG = LoggerFactory.getLogger(ConfigActivator.class);
- private List<ServiceRegistration<?>> registrations = new ArrayList<ServiceRegistration<?>>();
+ private List<ServiceRegistration<?>> registrations = new ArrayList<>();
private ProviderContext providerContext;
private ServiceTracker iNeutronNetworkCRUDTracker;
private ServiceTracker iNeutronPortCRUDTracker;
List<NeutronNetwork> allNetworks = neutronNetworkCache.getAllNetworks();
for (NeutronNetwork network: allNetworks) {
if (network.getID().equals(networkID)) {
- Map.Entry<String,String> entry = new AbstractMap.SimpleEntry<String, String>(
+ Map.Entry<String,String> entry = new AbstractMap.SimpleEntry<>(
network.getProviderNetworkType(), network.getProviderSegmentationID());
return entry;
}
@Override
public List<NeutronSecurityGroup> getSecurityGroupInPortList(OvsdbTerminationPointAugmentation
terminationPointAugmentation) {
- List<NeutronSecurityGroup> neutronSecurityGroups = new ArrayList<NeutronSecurityGroup>();
+ List<NeutronSecurityGroup> neutronSecurityGroups = new ArrayList<>();
if (neutronPortCache == null) {
LOG.error("neutron port is null");
return neutronSecurityGroups;
@Override
public List<Neutron_IPs> getVmListForSecurityGroup(List<Neutron_IPs> srcAddressList, String securityGroupUuid) {
- List<Neutron_IPs> vmListForSecurityGroup = new ArrayList<Neutron_IPs>();
+ List<Neutron_IPs> vmListForSecurityGroup = new ArrayList<>();
/*For every port check whether security grouplist contains the current
* security group.*/
try {
}
private List<ProtocolEntry> createMdsalProtocols() {
- List<ProtocolEntry> protocolList = new ArrayList<ProtocolEntry>();
+ List<ProtocolEntry> protocolList = new ArrayList<>();
ImmutableBiMap<String, Class<? extends OvsdbBridgeProtocolBase>> mapper =
MdsalHelper.OVSDB_PROTOCOL_MAP.inverse();
protocolList.add(new ProtocolEntryBuilder().
}
public List<Node> getAllBridgesOnOvsdbNode(Node node) {
- List<Node> nodes = new ArrayList<Node>();
+ List<Node> nodes = new ArrayList<>();
List<ManagedNodeEntry> managedNodes = node.getAugmentation(OvsdbNodeAugmentation.class).getManagedNodeEntry();
for (ManagedNodeEntry managedNode : managedNodes) {
InstanceIdentifier<?> bridgeIid = managedNode.getBridgeRef().getValue();
}
public List<TerminationPoint> extractTerminationPoints(Node node) {
- List<TerminationPoint> terminationPoints = new ArrayList<TerminationPoint>();
+ List<TerminationPoint> terminationPoints = new ArrayList<>();
OvsdbBridgeAugmentation ovsdbBridgeAugmentation = node.getAugmentation(OvsdbBridgeAugmentation.class);
if (ovsdbBridgeAugmentation != null) {
terminationPoints.addAll(node.getTerminationPoint());
}
public List<OvsdbTerminationPointAugmentation> extractTerminationPointAugmentations( Node node ) {
- List<OvsdbTerminationPointAugmentation> tpAugmentations = new ArrayList<OvsdbTerminationPointAugmentation>();
+ List<OvsdbTerminationPointAugmentation> tpAugmentations = new ArrayList<>();
List<TerminationPoint> terminationPoints = node.getTerminationPoint();
if(terminationPoints != null && !terminationPoints.isEmpty()){
for(TerminationPoint tp : terminationPoints){
if(operNode != null){
return extractTerminationPointAugmentations(operNode);
}
- return new ArrayList<OvsdbTerminationPointAugmentation>();
+ return new ArrayList<>();
}
public String getInterfaceExternalIdsValue(
tpAugmentationBuilder.setInterfaceType(MdsalHelper.OVSDB_INTERFACE_TYPE_MAP.get(type));
}
- List<Options> optionsList = new ArrayList<Options>();
+ List<Options> optionsList = new ArrayList<>();
for (Map.Entry<String, String> entry : options.entrySet()) {
OptionsBuilder optionsBuilder = new OptionsBuilder();
optionsBuilder.setKey(new OptionsKey(entry.getKey()));
}
public Boolean addPatchTerminationPoint(Node node, String bridgeName, String portName, String peerPortName) {
- Map<String, String> option = new HashMap<String, String>();
+ Map<String, String> option = new HashMap<>();
option.put("peer", peerPortName);
return addTerminationPoint(node, bridgeName, portName, PATCH_PORT_TYPE, option);
}
public void setUp() {
when(neutronLBPool.getLoadBalancerPoolProtocol()).thenReturn(LoadBalancerConfiguration.PROTOCOL_HTTP);
- List<NeutronLoadBalancerPoolMember> members = new ArrayList<NeutronLoadBalancerPoolMember>();
+ List<NeutronLoadBalancerPoolMember> members = new ArrayList<>();
NeutronLoadBalancerPoolMember neutronLBPoolMember = mock(NeutronLoadBalancerPoolMember.class);
when(neutronLBPoolMember.getPoolMemberAdminStateIsUp()).thenReturn(true);
when(neutronLBPoolMember.getPoolMemberSubnetID()).thenReturn("subnetID");
members.add(neutronLBPoolMember);
when(neutronLBPool.getLoadBalancerPoolMembers()).thenReturn(members);
- List<NeutronLoadBalancer> list_neutronLB = new ArrayList<NeutronLoadBalancer>();
+ List<NeutronLoadBalancer> list_neutronLB = new ArrayList<>();
NeutronLoadBalancer neutronLB = mock(NeutronLoadBalancer.class);
when(neutronLB.getLoadBalancerName()).thenReturn("load_balancer_name");
when(neutronLB.getLoadBalancerVipAddress()).thenReturn("vip_address");
NorthboundEvent ev = mock(NorthboundEvent.class);
when(ev.getLoadBalancerPool()).thenReturn(neutronLBPool);
- List<Node> list_node = new ArrayList<Node>();
+ List<Node> list_node = new ArrayList<>();
list_node .add(mock(Node.class));
when(nodeCacheManager.getBridgeNodes()).thenReturn(list_node);
when(NeutronCacheUtils.getMacAddress(any(INeutronPortCRUD.class), anyString(), anyString())).thenReturn("mac_address");
when(NeutronCacheUtils.getProviderInformation(any(INeutronNetworkCRUD.class), any(INeutronSubnetCRUD.class), anyString())).thenReturn(providerInfo);
- List<NeutronLoadBalancerPoolMember> members = new ArrayList<NeutronLoadBalancerPoolMember>();
+ List<NeutronLoadBalancerPoolMember> members = new ArrayList<>();
NeutronLoadBalancerPoolMember neutronLBPoolMember = mock(NeutronLoadBalancerPoolMember.class);
when(neutronLBPoolMember.getPoolMemberAdminStateIsUp()).thenReturn(true);
when(neutronLBPoolMember.getPoolMemberSubnetID()).thenReturn("subnetID");
when(neutronLBPool.getLoadBalancerPoolMembers()).thenReturn(members);
when(neutronLBPoolCache.getNeutronLoadBalancerPool(anyString())).thenReturn(neutronLBPool);
- List<NeutronLoadBalancer> list_neutronLB = new ArrayList<NeutronLoadBalancer>();
+ List<NeutronLoadBalancer> list_neutronLB = new ArrayList<>();
NeutronLoadBalancer neutronLB = mock(NeutronLoadBalancer.class);
when(neutronLB.getLoadBalancerName()).thenReturn("load_balancer_name");
when(neutronLB.getLoadBalancerVipAddress()).thenReturn("vip_address");
NorthboundEvent ev = mock(NorthboundEvent.class);
when(ev.getLoadBalancerPoolMember()).thenReturn(neutronLBMember);
- List<Node> list_node = new ArrayList<Node>();
+ List<Node> list_node = new ArrayList<>();
list_node .add(mock(Node.class));
when(nodeCacheManager.getBridgeNodes()).thenReturn(list_node);
Neutron_IPs ip = mock(Neutron_IPs.class);
when(ip.getIpAddress()).thenReturn("ip_address");
when(ip.getSubnetUUID()).thenReturn("subnetUUID");
- List<Neutron_IPs> list_fixedIP = new ArrayList<Neutron_IPs>();
+ List<Neutron_IPs> list_fixedIP = new ArrayList<>();
list_fixedIP.add(ip);
when(port.getFixedIPs()).thenReturn(list_fixedIP);
when(port.getMacAddress()).thenReturn("mac_address");
- List<NeutronPort> list_port = new ArrayList<NeutronPort>();
+ List<NeutronPort> list_port = new ArrayList<>();
list_port.add(port);
when(neutronPortsCache.getAllPorts()).thenReturn(list_port);
NeutronSubnet subnet = mock(NeutronSubnet.class);
when(subnet.getID()).thenReturn("subnetUUID");
when(subnet.getNetworkUUID()).thenReturn("networkUUID");
- List<NeutronSubnet> list_subnet = new ArrayList<NeutronSubnet>();
+ List<NeutronSubnet> list_subnet = new ArrayList<>();
list_subnet.add(subnet);
when(neutronSubnetCache.getAllSubnets()).thenReturn(list_subnet );
when(network.getID()).thenReturn("networkUUID");
when(network.getProviderNetworkType()).thenReturn("network_type_1");
when(network.getProviderSegmentationID()).thenReturn("network_segID");
- List<NeutronNetwork> list_network = new ArrayList<NeutronNetwork>();
+ List<NeutronNetwork> list_network = new ArrayList<>();
list_network.add(network);
when(neutronNetworkCache.getAllNetworks()).thenReturn(list_network);
- Map.Entry<String,String> entry = new AbstractMap.SimpleEntry<String, String>(
+ Map.Entry<String,String> entry = new AbstractMap.SimpleEntry<>(
network.getProviderNetworkType(), network.getProviderSegmentationID());
assertEquals("Error, getProviderInformation() did not return the correct values", entry, NeutronCacheUtils.getProviderInformation(neutronNetworkCache, neutronSubnetCache, "subnetUUID"));
portHandlerSpy.processEvent(ev);
verify(neutronL3Adapter, times(1)).handleNeutronPortEvent(neutronPort, Action.UPDATE);
- List<Node> nodes = new ArrayList<Node>();
+ List<Node> nodes = new ArrayList<>();
nodes.add(mock(Node.class));
when(nodeCacheManager.getNodes()).thenReturn(nodes);
- List<OvsdbTerminationPointAugmentation> ports = new ArrayList<OvsdbTerminationPointAugmentation>();
+ List<OvsdbTerminationPointAugmentation> ports = new ArrayList<>();
OvsdbTerminationPointAugmentation port = mock(OvsdbTerminationPointAugmentation.class);
ports.add(port);
when(southbound.getTerminationPointsOfBridge(any(Node.class))).thenReturn(ports);
Node node = mock(Node.class);
when(node.getAugmentation(OvsdbNodeAugmentation.class)).thenReturn(mock(OvsdbNodeAugmentation.class));
- List<Node> nodes = new ArrayList<Node>();
+ List<Node> nodes = new ArrayList<>();
nodes.add(mock(Node.class));
when(southbound.readOvsdbTopologyNodes()).thenReturn(nodes);
when(ev.getType()).thenReturn(Type.OPENVSWITCH);
when(ovsdbTerminationPointAugmentation.getName()).thenReturn("network");
- List<TerminationPoint> terminationPoints = new ArrayList<TerminationPoint>();
+ List<TerminationPoint> terminationPoints = new ArrayList<>();
terminationPoints.add(mock(TerminationPoint.class));
when(southbound.extractTerminationPoints(any(Node.class))).thenReturn(terminationPoints);
@Test
public void testHandleNeutronPortEvent() throws Exception {
- Map<String, NeutronRouter_Interface> subnetIdToRouterInterfaceCache = new HashMap<String, NeutronRouter_Interface>();
+ Map<String, NeutronRouter_Interface> subnetIdToRouterInterfaceCache = new HashMap<>();
// Mock variables
Neutron_IPs neutronIP = mock(Neutron_IPs.class);
when(neutronIP.getSubnetUUID()).thenReturn(UUID);
- List<Neutron_IPs> list_neutronIP = new ArrayList<Neutron_IPs>();
+ List<Neutron_IPs> list_neutronIP = new ArrayList<>();
list_neutronIP.add(neutronIP);
NeutronPort neutronPort = mock(NeutronPort.class);
when(neutronPort.getDeviceOwner()).thenReturn(OWNER_ROUTER_INTERFACE);
Neutron_IPs neutronIP = mock(Neutron_IPs.class);
when(neutronIP.getSubnetUUID()).thenReturn(UUID);
NeutronPort neutronPort = mock(NeutronPort.class);
- List<Neutron_IPs> list_neutronIP = new ArrayList<Neutron_IPs>();
+ List<Neutron_IPs> list_neutronIP = new ArrayList<>();
list_neutronIP.add(neutronIP);
when(neutronPort.getFixedIPs()).thenReturn(list_neutronIP);
List<NeutronPort> list_neutronPort = new ArrayList<>();
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void testProgramFlowsForFloatingIPArpAdd() throws Exception {
- Map<String, Pair> neutronPortToDpIdCache = new HashMap<String, Pair>();
- Map<String, String> networkIdToRouterMacCache = new HashMap<String, String>();
+ Map<String, Pair> neutronPortToDpIdCache = new HashMap<>();
+ Map<String, String> networkIdToRouterMacCache = new HashMap<>();
Map floatIpDataMapCache = new HashMap();
NeutronFloatingIP neutronFloatingIP = mock(NeutronFloatingIP.class);
ConfigurationService configurationService = mock(ConfigurationService.class);
when(configurationService.getPatchPortName(any(Pair.class))).thenReturn(PORT_INT);
MemberModifier.field(NeutronL3Adapter.class, "configurationService").set(neutronL3Adapter , configurationService);
- List<Node> nodes = new ArrayList<Node>();
+ List<Node> nodes = new ArrayList<>();
nodes.add(mock(Node.class));
NodeCacheManager nodeCacheManager = mock(NodeCacheManager.class);
when(nodeCacheManager.getBridgeNodes()).thenReturn(nodes);
@Test
public void testHandleInterfaceEvent() throws Exception {
- Map<String, Pair<Long, Uuid>> neutronPortToDpIdCache = new HashMap<String, Pair<Long,Uuid>>();
+ Map<String, Pair<Long, Uuid>> neutronPortToDpIdCache = new HashMap<>();
// init instance variables
TenantNetworkManager tenantNetworkManager = mock(TenantNetworkManager.class);
MemberModifier.field(NeutronL3Adapter.class, "tenantNetworkManager").set(neutronL3Adapter , tenantNetworkManager);
@Test
public void testHandleInterfaceEventAdd() throws Exception {
- Map<String, Pair<Long, Uuid>> neutronPortToDpIdCache = new HashMap<String, Pair<Long,Uuid>>();
+ Map<String, Pair<Long, Uuid>> neutronPortToDpIdCache = new HashMap<>();
// init instance variables
MemberModifier.field(NeutronL3Adapter.class, "neutronPortToDpIdCache").set(neutronL3Adapter , neutronPortToDpIdCache);
int temp = neutronPortToDpIdCache.size();
@SuppressWarnings("unchecked")
@Test
public void testHandleInterfaceEventDelete() throws Exception {
- Map<String, Pair<Long, Uuid>> neutronPortToDpIdCache = new HashMap<String, Pair<Long,Uuid>>();
+ Map<String, Pair<Long, Uuid>> neutronPortToDpIdCache = new HashMap<>();
OvsdbTerminationPointAugmentation intf = mock(OvsdbTerminationPointAugmentation.class);
Uuid uuid = mock(Uuid.class);
when(intf.getInterfaceUuid()).thenReturn(uuid );
@Test
public void testUpdateL3ForNeutronPort() throws Exception {
- Map<String, String> networkIdToRouterMacCache = new HashMap<String, String>();
+ Map<String, String> networkIdToRouterMacCache = new HashMap<>();
Neutron_IPs neutronIp = mock(Neutron_IPs.class);
when(neutronIp.getIpAddress()).thenReturn(FIXED_IP_ADDRESS);
- List<Neutron_IPs> neutronIps = new ArrayList<Neutron_IPs>();
+ List<Neutron_IPs> neutronIps = new ArrayList<>();
neutronIps.add(neutronIp);
NeutronPort neutronPort = mock(NeutronPort.class);
when(neutronPort.getNetworkUUID()).thenReturn(UUID);
when(neutronPort.getFixedIPs()).thenReturn(neutronIps);
NeutronNetwork neutronNetwork = mock(NeutronNetwork.class);
when(neutronNetwork.getProviderSegmentationID()).thenReturn(ID);
- List<Node> nodes = new ArrayList<Node>();
+ List<Node> nodes = new ArrayList<>();
nodes.add(mock(Node.class));
PowerMockito.doReturn(Long.valueOf(15)).when(neutronL3Adapter, "getDpidForIntegrationBridge", any(Node.class));
// either add or remove item in l3ForwardingCache
@Test
public void testProgramL3ForwardingStage1() throws Exception {
- Set<String> l3ForwardingCache = new HashSet<String>();
+ Set<String> l3ForwardingCache = new HashSet<>();
NodeId nodeId = mock(NodeId.class);
when(nodeId.getValue()).thenReturn(ID);
@Test
public void testProgramFlowsForNeutronRouterInterface() throws Exception {
- Map<String, String> networkIdToRouterMacCache = new HashMap<String, String>();
- Map<String, List<Neutron_IPs>> networkIdToRouterIpListCache = new HashMap<String, List<Neutron_IPs>>();
- Map<String, NeutronRouter_Interface> subnetIdToRouterInterfaceCache = new HashMap<String, NeutronRouter_Interface>();
+ Map<String, String> networkIdToRouterMacCache = new HashMap<>();
+ Map<String, List<Neutron_IPs>> networkIdToRouterIpListCache = new HashMap<>();
+ Map<String, NeutronRouter_Interface> subnetIdToRouterInterfaceCache = new HashMap<>();
NeutronRouter_Interface intf = mock(NeutronRouter_Interface.class);
when(intf.getPortUUID()).thenReturn(UUID);
when(intf.getSubnetUUID()).thenReturn(UUID);
Neutron_IPs neutronIp = mock(Neutron_IPs.class);
when(neutronIp.getIpAddress()).thenReturn(FIXED_IP_ADDRESS);
- List<Neutron_IPs> ips = new ArrayList<Neutron_IPs>();
+ List<Neutron_IPs> ips = new ArrayList<>();
ips.add(neutronIp);
NeutronPort neutronPort = mock(NeutronPort.class);
when(neutronPort.getMacAddress()).thenReturn(MAC_ADDRESS);
NeutronRouter neutronRouter = mock(NeutronRouter.class);
Node node = mock(Node.class);
- List<Node> nodes = new ArrayList<Node>();
+ List<Node> nodes = new ArrayList<>();
nodes.add(node);
MemberModifier.suppress(MemberMatcher.method(NeutronL3Adapter.class, "getDpidForIntegrationBridge", Node.class));
when(neutronNetwork.getProviderSegmentationID()).thenReturn(ID);
Neutron_IPs ip = mock(Neutron_IPs.class);
when(ip.getIpAddress()).thenReturn(IP);
- List<Neutron_IPs> ips = new ArrayList<Neutron_IPs>();
+ List<Neutron_IPs> ips = new ArrayList<>();
ips.add(ip);
ips.add(ip);
ips.add(ip);
@Test
public void testProgramRouterInterfaceStage1() throws Exception {
- Set<String> routerInterfacesCache = new HashSet<String>();
+ Set<String> routerInterfacesCache = new HashSet<>();
NodeId nodeId = mock(NodeId.class);
when(nodeId.getValue()).thenReturn(ID);
//either add or remove staticArpEntryCache
@Test
public void testProgramStaticArpStage1() throws Exception {
- Set<String> staticArpEntryCache = new HashSet<String>();
+ Set<String> staticArpEntryCache = new HashSet<>();
MemberModifier.suppress(MemberMatcher.method(NeutronL3Adapter.class, "programStaticArpStage2", Long.class, String.class, String.class, String.class, Action.class));
// either add or remove inboundIpRewriteCache
@Test
public void testProgramInboundIpRewriteStage1() throws Exception {
- Set<String> inboundIpRewriteCache = new HashSet<String>();
+ Set<String> inboundIpRewriteCache = new HashSet<>();
MemberModifier.suppress(MemberMatcher.method(NeutronL3Adapter.class, "programInboundIpRewriteStage2", Long.class, Long.class, String.class, String.class, String.class, Action.class));
// either add or remove outboundIpRewriteExclusionCache
@Test
public void testProgramIpRewriteExclusionStage1() throws Exception {
- Set<String> outboundIpRewriteExclusionCache = new HashSet<String>();
+ Set<String> outboundIpRewriteExclusionCache = new HashSet<>();
NodeId nodeId = mock(NodeId.class);
when(nodeId.getValue()).thenReturn(ID);
@SuppressWarnings("unchecked")
@Test
public void testProgramOutboundIpRewriteStage1() throws Exception{
- HashSet<String> outboundIpRewriteCache = new HashSet<String>();
+ Set<String> outboundIpRewriteCache = new HashSet<>();
MemberModifier.suppress(MemberMatcher.method(NeutronL3Adapter.class, "programOutboundIpRewriteStage2", floatingIpClass, Action.class));
public void setUp(){
NeutronPort neutronPort = mock(NeutronPort.class);
- List<NeutronSecurityGroup> securityGroups = new ArrayList<NeutronSecurityGroup>();
+ List<NeutronSecurityGroup> securityGroups = new ArrayList<>();
securityGroups.add(neutronSecurityGroup);
when(neutronPort.getSecurityGroups()).thenReturn(securityGroups);
NeutronNetwork neutronNetwork = mock(NeutronNetwork.class);
when(neutronNetwork.getProviderSegmentationID()).thenReturn(SEG_ID);
when(neutronNetwork.getNetworkUUID()).thenReturn(NETWORK_ID);
- ArrayList<NeutronNetwork> listNeutronNetwork = new ArrayList<NeutronNetwork>();
+ List<NeutronNetwork> listNeutronNetwork = new ArrayList<>();
listNeutronNetwork.add(neutronNetwork);
when(neutronNetworkCache.getAllNetworks()).thenReturn(listNeutronNetwork);
when(neutronPort.getNetworkUUID()).thenReturn(NETWORK_ID);
when(neutronPortCache.getPort(anyString())).thenReturn(neutronPort);
- List<OvsdbTerminationPointAugmentation> ports = new ArrayList<OvsdbTerminationPointAugmentation>();
+ List<OvsdbTerminationPointAugmentation> ports = new ArrayList<>();
ports.add(mock(OvsdbTerminationPointAugmentation.class));
when(southbound.getTerminationPointsOfBridge(any(Node.class))).thenReturn(ports);
@Test
public void testGetNetworkId() {
NeutronNetwork neutronNetwork = mock(NeutronNetwork.class);
- ArrayList<NeutronNetwork> listNeutronNetwork = new ArrayList<NeutronNetwork>();
+ List<NeutronNetwork> listNeutronNetwork = new ArrayList<>();
listNeutronNetwork.add(neutronNetwork);
when(neutronNetwork.getProviderSegmentationID()).thenReturn("segId");
@Before
public void setUp(){
when(southbound.getOvsdbNodeUUID(any(Node.class))).thenReturn(NODE_UUID);
- List<OvsdbTerminationPointAugmentation> ports = new ArrayList<OvsdbTerminationPointAugmentation>();
+ List<OvsdbTerminationPointAugmentation> ports = new ArrayList<>();
OvsdbTerminationPointAugmentation port = mock(OvsdbTerminationPointAugmentation.class);
VlanId vlanId = mock(VlanId.class);
when(vlanId.getValue()).thenReturn(VLAN_ID);