Migrate tests away from Optional.get()
[bgpcep.git] / bgp / openconfig-rp-spi / src / test / java / org / opendaylight / protocol / bgp / openconfig / routing / policy / spi / AppendActionTest.java
index 41b5ad4b4d3abda8c8985500ca7a47654e5dbdda..52b81bc3a0152defff64af84c2f8cf3927b104fc 100644 (file)
@@ -51,7 +51,7 @@ public class AppendActionTest extends AbstractStatementRegistryTest {
     @Test
     public void testMultipleAppend() {
         Statement statement = basicStatements.stream()
-                .filter(st -> st.getName().equals("multiple-append-test")).findFirst().get();
+                .filter(st -> st.getName().equals("multiple-append-test")).findFirst().orElseThrow();
         final RouteAttributeContainer attributeContainer
                 = routeAttributeContainerFalse(new AttributesBuilder().build());
         RouteAttributeContainer result = statementRegistry.applyExportStatement(
@@ -74,7 +74,7 @@ public class AppendActionTest extends AbstractStatementRegistryTest {
     @Test
     public void testNextHopSelf() {
         Statement statement = basicStatements.stream()
-                .filter(st -> st.getName().equals("next-hop-self-append-test")).findFirst().get();
+                .filter(st -> st.getName().equals("next-hop-self-append-test")).findFirst().orElseThrow();
         final RouteAttributeContainer attributeContainer
                 = routeAttributeContainerFalse(new AttributesBuilder().build());
         RouteAttributeContainer result = statementRegistry.applyExportStatement(