Turn restconf-server-api into a module 50/112650/1
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 20 Jul 2024 12:46:04 +0000 (14:46 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 20 Jul 2024 12:46:30 +0000 (14:46 +0200)
Add module-info.java and clean up reported warnings.

JIRA: NETCONF-773
Change-Id: I5b541656d6cf16217b525a5dcb1e7e87ab078b0b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
protocol/restconf-server-api/src/main/java/module-info.java [new file with mode: 0644]
protocol/restconf-server-api/src/main/java/org/opendaylight/restconf/server/api/ServerException.java
protocol/restconf-server-api/src/test/java/org/opendaylight/restconf/server/api/ParamsTest.java

diff --git a/protocol/restconf-server-api/src/main/java/module-info.java b/protocol/restconf-server-api/src/main/java/module-info.java
new file mode 100644 (file)
index 0000000..280c98d
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2024 PANTHEON.tech, s.r.o. 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
+ */
+/**
+ * RESTCONF server API.
+ */
+module org.opendaylight.restconf.server.api {
+    exports org.opendaylight.restconf.server.api;
+
+    requires transitive com.google.common;
+    requires transitive org.opendaylight.restconf.api;
+    requires transitive org.opendaylight.yangtools.yang.data.api;
+    requires transitive org.opendaylight.yangtools.yang.data.codec.gson;
+    requires transitive org.opendaylight.yangtools.yang.data.codec.xml;
+    requires transitive org.opendaylight.yangtools.yang.data.util;
+    requires transitive org.opendaylight.yangtools.yang.model.api;
+    requires transitive org.opendaylight.yang.gen.ietf.yang.patch.rfc8072;
+    requires org.opendaylight.yang.gen.ietf.restconf.rfc8040;
+    requires org.opendaylight.yangtools.yang.data.impl;
+    requires org.opendaylight.yangtools.yang.data.spi;
+    requires org.slf4j;
+    requires stax.utils;
+
+    // Annotation-only dependencies
+    requires static transitive org.eclipse.jdt.annotation;
+    requires static com.github.spotbugs.annotations;
+}
index fc8476c2c96a6e2f0435af597ddbb48a60180ee0..2b1e693efe19ef5d7e5525de71a3af3ca2c97926 100644 (file)
@@ -31,6 +31,7 @@ public final class ServerException extends Exception {
     @java.io.Serial
     private static final long serialVersionUID = 0L;
 
+    @SuppressWarnings("serial")
     private final List<ServerError> errors;
 
     ServerException(final String message, final List<ServerError> errors, final @Nullable Throwable cause) {
index ef4e3cc64f91e31a4a548531d17807aa7875c72c..2ee3943cac483345fc102309d07968863bb1b437 100644 (file)
@@ -16,7 +16,6 @@ import org.junit.jupiter.api.Test;
 import org.opendaylight.restconf.api.QueryParameters;
 import org.opendaylight.restconf.api.query.ContentParam;
 import org.opendaylight.restconf.api.query.DepthParam;
-import org.opendaylight.restconf.api.query.RestconfQueryParam;
 import org.opendaylight.restconf.api.query.WithDefaultsParam;
 
 class ParamsTest {
@@ -84,16 +83,6 @@ class ParamsTest {
         assertEquals(WithDefaultsParam.EXPLICIT, params.withDefaults());
     }
 
-    private static void assertInvalidIAE(final Function<QueryParameters, ?> paramsMethod,
-            final RestconfQueryParam<?> param) {
-        assertParamsThrows("Invalid parameter: " + param.paramName(), paramsMethod, param.paramName(),
-            "odl-test-value");
-    }
-
-    private static void assertInvalidIAE(final Function<QueryParameters, ?> paramsMethod) {
-        assertParamsThrows("Invalid parameter: odl-unknown-param", paramsMethod, "odl-unknown-param", "odl-test-value");
-    }
-
     private static void assertParamsThrows(final String expectedMessage,
             final Function<QueryParameters, ?> paramsMethod, final String name, final String value) {
         assertParamsThrows(expectedMessage, paramsMethod, QueryParameters.of(name, value));