Bump MRI upstreams
[openflowplugin.git] / applications / topology-lldp-discovery / src / test / java / org / opendaylight / openflowplugin / applications / topology / lldp / LLDPLinkAgerTest.java
index aea9f55be8ea8b55640ceead6e793e9951ce42b9..4628f02b1e28ea7e0869a5ba9667efeaa8645a4f 100644 (file)
@@ -1,11 +1,10 @@
-/**
+/*
  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.applications.topology.lldp;
 
 import static org.junit.Assert.assertFalse;
@@ -19,7 +18,8 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.Mockito;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
 import org.opendaylight.mdsal.eos.binding.api.Entity;
 import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
@@ -36,19 +36,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.lldp.discovery.config.rev160511.TopologyLldpDiscoveryConfig;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.lldp.discovery.config.rev160511.TopologyLldpDiscoveryConfigBuilder;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Test for {@link LLDPLinkAger}.
  */
 @RunWith(MockitoJUnitRunner.class)
 public class LLDPLinkAgerTest {
-
-    private static final Logger LOG = LoggerFactory.getLogger(LLDPLinkAgerTest.class);
-
-    private static final long LLDP_INTERVAL = 5L;
-    private static final long LINK_EXPIRATION_TIME = 10L;
+    private static final Uint32 LLDP_INTERVAL = Uint32.valueOf(5);
+    private static final Uint32 LINK_EXPIRATION_TIME = Uint32.TEN;
 
     /**
      * We need to wait while other tasks are finished before we can check anything in LLDPAgingTask.
@@ -64,11 +60,14 @@ public class LLDPLinkAgerTest {
     @Mock
     private EntityOwnershipService eos;
     @Mock
+    private DataBroker dataBroker;
+    @Mock
     private LinkRemoved linkRemoved;
 
+
     @Before
     public void setUp() {
-        lldpLinkAger = new LLDPLinkAger(getConfig(), notificationService, getConfigurationService(), eos);
+        lldpLinkAger = new LLDPLinkAger(getConfig(), notificationService, getConfigurationService(), eos, dataBroker);
         Mockito.when(link.getDestination()).thenReturn(new NodeConnectorRef(
                 InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(new NodeId("openflow:1")))));
         Mockito.when(eos.getOwnershipState(any(Entity.class))).thenReturn(
@@ -98,14 +97,14 @@ public class LLDPLinkAgerTest {
         verify(notificationService).putNotification(any(LinkRemoved.class));
     }
 
-    private TopologyLldpDiscoveryConfig getConfig() {
+    private static TopologyLldpDiscoveryConfig getConfig() {
         TopologyLldpDiscoveryConfigBuilder cfgBuilder = new TopologyLldpDiscoveryConfigBuilder();
         cfgBuilder.setTopologyLldpInterval(new NonZeroUint32Type(LLDP_INTERVAL));
         cfgBuilder.setTopologyLldpExpirationInterval(new NonZeroUint32Type(LINK_EXPIRATION_TIME));
         return cfgBuilder.build();
     }
 
-    private ConfigurationService getConfigurationService() {
+    private static ConfigurationService getConfigurationService() {
         final ConfigurationService configurationService = Mockito.mock(ConfigurationService.class);
         final TopologyLldpDiscoveryConfig config = getConfig();