summaryrefslogtreecommitdiffstats
path: root/lisp/lisp2vpp/src/test/java/io/fd
diff options
context:
space:
mode:
authorMichal Cmarada <mcmarada@cisco.com>2019-04-01 11:39:35 +0200
committerMichal Cmarada <mcmarada@cisco.com>2019-04-08 13:39:49 +0200
commitd726d0f173544c8d0078c5f918b5d086f6e85f79 (patch)
tree640e65411731b3a25abc2e7949de68dc625cf60e /lisp/lisp2vpp/src/test/java/io/fd
parent89eeb336aebc92cd34c27b3fa325803c6478a461 (diff)
HC2VPP-406: fix build errors after ODL bump to neon
This fixes build issues after ODL bump in Honeycomb (HONEYCOMB-443). Change-Id: I3bf203dd60d12057595b15ce1ad59302dc14e2a0 Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
Diffstat (limited to 'lisp/lisp2vpp/src/test/java/io/fd')
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/LispModuleTest.java2
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/context/util/AdjacenciesMappingContextTest.java2
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LispStateCustomizerTest.java6
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImplTest.java6
-rwxr-xr-xlisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocatorSetCustomizerTest.java9
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/VniTableCustomizerTest.java6
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/util/AdjacencyMappingContextTestHelper.java4
-rw-r--r--lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/util/EidMappingContextHelper.java4
8 files changed, 20 insertions, 19 deletions
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/LispModuleTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/LispModuleTest.java
index ffaf3206b..b9f0bf837 100644
--- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/LispModuleTest.java
+++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/LispModuleTest.java
@@ -40,7 +40,7 @@ import java.util.Set;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
public class LispModuleTest {
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/context/util/AdjacenciesMappingContextTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/context/util/AdjacenciesMappingContextTest.java
index 61ebcfbe3..4c8cfa262 100644
--- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/context/util/AdjacenciesMappingContextTest.java
+++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/context/util/AdjacenciesMappingContextTest.java
@@ -22,7 +22,7 @@ import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import com.google.common.base.Optional;
+import java.util.Optional;
import com.google.common.collect.ImmutableSet;
import io.fd.honeycomb.test.tools.HoneycombTestRunner;
import io.fd.honeycomb.test.tools.annotations.InjectTestData;
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LispStateCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LispStateCustomizerTest.java
index 4ac7a241a..b64b862a3 100644
--- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LispStateCustomizerTest.java
+++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/read/LispStateCustomizerTest.java
@@ -23,7 +23,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
-import com.google.common.base.Optional;
+import java.util.Optional;
import com.google.common.collect.ImmutableSet;
import io.fd.hc2vpp.common.test.read.InitializingReaderCustomizerTest;
import io.fd.hc2vpp.common.test.util.NamingContextHelper;
@@ -131,9 +131,9 @@ public class LispStateCustomizerTest extends InitializingReaderCustomizerTest<Li
when(mappingContext.read(namingContextId.child(Mappings.class)))
.thenReturn(Optional.of(new MappingsBuilder().setMapping(Arrays.asList(loc1Data, loc2Data)).build()));
- when(mappingContext.read(loc1Key)).thenReturn(Optional.absent())
+ when(mappingContext.read(loc1Key)).thenReturn(Optional.empty())
.thenReturn(Optional.of(loc1Data)).thenReturn(Optional.of(loc1Data));
- when(mappingContext.read(loc2Key)).thenReturn(Optional.absent())
+ when(mappingContext.read(loc2Key)).thenReturn(Optional.empty())
.thenReturn(Optional.of(loc2Data)).thenReturn(Optional.of(loc2Data));
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImplTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImplTest.java
index 294bd5466..4352c9b06 100644
--- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImplTest.java
+++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/service/LispStateCheckServiceImplTest.java
@@ -22,7 +22,7 @@ import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
-import com.google.common.base.Optional;
+import java.util.Optional;
import io.fd.hc2vpp.common.test.util.FutureProducer;
import io.fd.honeycomb.translate.ModificationCache;
import io.fd.honeycomb.translate.read.ReadContext;
@@ -58,7 +58,7 @@ public class LispStateCheckServiceImplTest implements FutureProducer {
@Test(expected = IllegalStateException.class)
public void testCheckLispEnabledBeforeNoConfig() throws Exception {
- when(writeContext.readBefore(InstanceIdentifier.create(Lisp.class))).thenReturn(Optional.absent());
+ when(writeContext.readBefore(InstanceIdentifier.create(Lisp.class))).thenReturn(Optional.empty());
impl.checkLispEnabledBefore(writeContext);
}
@@ -79,7 +79,7 @@ public class LispStateCheckServiceImplTest implements FutureProducer {
@Test(expected = IllegalStateException.class)
public void testCheckLispEnabledAfterNoConfig() throws Exception {
- when(writeContext.readAfter(InstanceIdentifier.create(Lisp.class))).thenReturn(Optional.absent());
+ when(writeContext.readAfter(InstanceIdentifier.create(Lisp.class))).thenReturn(Optional.empty());
impl.checkLispEnabledAfter(writeContext);
}
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocatorSetCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocatorSetCustomizerTest.java
index b8ad46b6f..74b22e41a 100755
--- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocatorSetCustomizerTest.java
+++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/LocatorSetCustomizerTest.java
@@ -26,7 +26,6 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
-import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;
import io.fd.hc2vpp.common.translate.util.NamingContext;
import io.fd.honeycomb.translate.write.WriteFailedException;
@@ -36,6 +35,8 @@ import io.fd.jvpp.core.dto.OneLocatorSetDetails;
import io.fd.jvpp.core.dto.OneLocatorSetDetailsReplyDump;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
+import java.util.NoSuchElementException;
+import java.util.Optional;
import java.util.concurrent.ExecutionException;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
@@ -76,12 +77,12 @@ public class LocatorSetCustomizerTest extends LispWriterCustomizerTest {
lispStateCheckService);
}
- @Test(expected = NullPointerException.class)
+ @Test(expected = NoSuchElementException.class)
public void testWriteCurrentAttributesNullData() throws WriteFailedException {
customizer.writeCurrentAttributes(null, null, writeContext);
}
- @Test(expected = NullPointerException.class)
+ @Test(expected = NoSuchElementException.class)
public void testWriteCurrentAttributesBadData() throws WriteFailedException {
customizer.writeCurrentAttributes(null, mock(LocatorSet.class), writeContext);
}
@@ -138,7 +139,7 @@ public class LocatorSetCustomizerTest extends LispWriterCustomizerTest {
@Test
public void testDeleteCurrentAttributes() throws InterruptedException, ExecutionException, WriteFailedException {
- when(writeContext.readAfter(EID_TABLE_ID)).thenReturn(Optional.absent());
+ when(writeContext.readAfter(EID_TABLE_ID)).thenReturn(Optional.empty());
verifySuccessfullDelete(LOCATOR_SET_TO_DELETE);
}
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/VniTableCustomizerTest.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/VniTableCustomizerTest.java
index 19ff5cbba..ee5f1b092 100644
--- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/VniTableCustomizerTest.java
+++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/translate/write/VniTableCustomizerTest.java
@@ -22,7 +22,7 @@ import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
-import com.google.common.base.Optional;
+import java.util.Optional;
import io.fd.honeycomb.translate.write.WriteFailedException;
import org.junit.Before;
import org.junit.Test;
@@ -116,7 +116,7 @@ public class VniTableCustomizerTest extends LispWriterCustomizerTest {
}
private void whenReadBeforeReturnInvalid() {
- when(writeContext.readBefore(validId)).thenReturn(Optional.absent());
+ when(writeContext.readBefore(validId)).thenReturn(Optional.empty());
}
private void whenReadAfterReturnValid() {
@@ -124,6 +124,6 @@ public class VniTableCustomizerTest extends LispWriterCustomizerTest {
}
private void whenReadAfterReturnInvalid() {
- when(writeContext.readAfter(validId)).thenReturn(Optional.absent());
+ when(writeContext.readAfter(validId)).thenReturn(Optional.empty());
}
}
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/util/AdjacencyMappingContextTestHelper.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/util/AdjacencyMappingContextTestHelper.java
index 76dd34ff5..52ae27570 100644
--- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/util/AdjacencyMappingContextTestHelper.java
+++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/util/AdjacencyMappingContextTestHelper.java
@@ -19,7 +19,7 @@ package io.fd.hc2vpp.lisp.util;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.mockito.Mockito.doReturn;
-import com.google.common.base.Optional;
+import java.util.Optional;
import com.google.common.collect.Lists;
import io.fd.honeycomb.translate.MappingContext;
import java.util.List;
@@ -109,7 +109,7 @@ public interface AdjacencyMappingContextTestHelper {
final List<Mapping> list = Common.getMappingList(mappingContext, iid);
doReturn(Optional.of(new MappingsBuilder().setMapping(list).build())).when(mappingContext).read(iid);
- doReturn(Optional.absent()).when(mappingContext).read(mappingIid(name, namingContextName));
+ doReturn(Optional.empty()).when(mappingContext).read(mappingIid(name, namingContextName));
}
final class Common {
diff --git a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/util/EidMappingContextHelper.java b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/util/EidMappingContextHelper.java
index bd2be3013..728bc7ea0 100644
--- a/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/util/EidMappingContextHelper.java
+++ b/lisp/lisp2vpp/src/test/java/io/fd/hc2vpp/lisp/util/EidMappingContextHelper.java
@@ -19,7 +19,7 @@ package io.fd.hc2vpp.lisp.util;
import static org.mockito.Mockito.doReturn;
-import com.google.common.base.Optional;
+import java.util.Optional;
import com.google.common.collect.Lists;
import io.fd.honeycomb.translate.MappingContext;
import java.util.List;
@@ -96,7 +96,7 @@ public interface EidMappingContextHelper {
final List<Mapping> list = Common.getMappingList(mappingContext, iid);
doReturn(Optional.of(new MappingsBuilder().setMapping(list).build())).when(mappingContext).read(iid);
- doReturn(Optional.absent()).when(mappingContext).read(mappingIid(new MappingId(name), namingContextName));
+ doReturn(Optional.empty()).when(mappingContext).read(mappingIid(new MappingId(name), namingContextName));
}
final class Common {