Change Optional.ofNullable calls to Optional.of
Nullable check is not needed because argument is known to be non null
Change-Id: Ie3574ad9bbd1eff8a2088ac8da2804ea2f5e90a1
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/MplsPathIntentInstallerTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/MplsPathIntentInstallerTest.java
index c2f616a..d091b9a 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/MplsPathIntentInstallerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/MplsPathIntentInstallerTest.java
@@ -48,9 +48,9 @@
MplsPathIntentInstaller installer;
private final Optional<MplsLabel> ingressLabel =
- Optional.ofNullable(MplsLabel.mplsLabel(10));
+ Optional.of(MplsLabel.mplsLabel(10));
private final Optional<MplsLabel> egressLabel =
- Optional.ofNullable(MplsLabel.mplsLabel(20));
+ Optional.of(MplsLabel.mplsLabel(20));
private final List<Link> links = Arrays.asList(
new DefaultLink(PID, d1p1, d2p0, DIRECT),
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MplsIntentCompilerTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MplsIntentCompilerTest.java
index 40bacb9..1d297f0 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MplsIntentCompilerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MplsIntentCompilerTest.java
@@ -80,8 +80,8 @@
*/
@Test
public void testForwardPathCompilation() {
- Optional<MplsLabel> ingressLabel = Optional.ofNullable(MplsLabel.mplsLabel(10));
- Optional<MplsLabel> egressLabel = Optional.ofNullable(MplsLabel.mplsLabel(20));
+ Optional<MplsLabel> ingressLabel = Optional.of(MplsLabel.mplsLabel(10));
+ Optional<MplsLabel> egressLabel = Optional.of(MplsLabel.mplsLabel(20));
MplsIntent intent = makeIntent("d1", ingressLabel, "d8", egressLabel);
assertThat(intent, is(notNullValue()));
@@ -117,8 +117,8 @@
*/
@Test
public void testReversePathCompilation() {
- Optional<MplsLabel> ingressLabel = Optional.ofNullable(MplsLabel.mplsLabel(10));
- Optional<MplsLabel> egressLabel = Optional.ofNullable(MplsLabel.mplsLabel(20));
+ Optional<MplsLabel> ingressLabel = Optional.of(MplsLabel.mplsLabel(10));
+ Optional<MplsLabel> egressLabel = Optional.of(MplsLabel.mplsLabel(20));
MplsIntent intent = makeIntent("d8", ingressLabel, "d1", egressLabel);
assertThat(intent, is(notNullValue()));