Move RestconfSchemaSourceUrlProvider 03/109103/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 28 Nov 2023 16:21:19 +0000 (17:21 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 28 Nov 2023 16:22:31 +0000 (17:22 +0100)
This component is part of dealing with yang-library content, similar to
what we are doing for ietf-restconf, as both really should be transient
state.

Move it to restconf.server.mdsal, so it is co-located with other
datastore state-keeping components.

JIRA: NETCONF-773
Change-Id: I03da2c230123dbcbe04547e7304413c356f116b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/server/mdsal/RestconfSchemaSourceUrlProvider.java [moved from restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfSchemaSourceUrlProvider.java with 97% similarity]
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/server/mdsal/RestconfSchemaSourceUrlProviderTest.java [moved from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfSchemaSourceUrlProviderTest.java with 91% similarity]

@@ -5,7 +5,7 @@
  * 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.restconf.nb.rfc8040.rests.services.impl;
+package org.opendaylight.restconf.server.mdsal;
 
 import java.util.Optional;
 import javax.inject.Inject;
@@ -5,7 +5,7 @@
  * 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.restconf.nb.rfc8040.rests.services.impl;
+package org.opendaylight.restconf.server.mdsal;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -30,14 +30,14 @@ class RestconfSchemaSourceUrlProviderTest {
     }
 
     @ParameterizedTest(name = "Supported module-set name. URL: {2}")
-    @MethodSource("getSchemaSourceUrlArgs")
+    @MethodSource
     void getSchemaSourceUrl(final String moduleName, final Revision revision, final Uri expected) {
         final var urlProvider = new RestconfSchemaSourceUrlProvider();
         final var result = urlProvider.getSchemaSourceUrl("ODL_modules", moduleName, revision);
         assertEquals(Optional.of(expected), result);
     }
 
-    private static List<Arguments> getSchemaSourceUrlArgs() {
+    private static List<Arguments> getSchemaSourceUrl() {
         return List.of(
             Arguments.of("odl-module", Revision.of("2023-02-23"),
                 new Uri("/rests/modules/odl-module?revision=2023-02-23")),