Introduce restconf.nb.jaxrs package 20/109020/3
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 18 Nov 2023 04:06:49 +0000 (05:06 +0100)
committerRobert Varga <nite@hq.sk>
Sat, 18 Nov 2023 14:31:56 +0000 (14:31 +0000)
We have reached a place where we can clean up JAX-RS northbound
components without worrying about weird dependencies.

Refactor RestconfImpl into restconf.nb.jaxrs.JaxRsRestconf.

JIRA: NETCONF-773
Change-Id: I75dbe87f2276be12157616779ec78b988863daac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
16 files changed:
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/JaxRsRestconf.java [moved from restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfImpl.java with 98% similarity]
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/JaxRsRestconfCallback.java [moved from restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/JaxRsRestconfCallback.java with 94% similarity]
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/package-info.java [new file with mode: 0644]
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/RestconfApplication.java
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/AbstractRestconfTest.java [moved from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/AbstractRestconfTest.java with 90% similarity]
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/Netconf799Test.java [moved from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/Netconf799Test.java with 85% similarity]
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/Netconf822Test.java [moved from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/Netconf822Test.java with 96% similarity]
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/RestconfDataDeleteTest.java [moved from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataDeleteTest.java with 98% similarity]
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/RestconfDataGetTest.java [moved from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataGetTest.java with 99% similarity]
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/RestconfDataPatchTest.java [moved from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataPatchTest.java with 99% similarity]
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/RestconfDataPostTest.java [moved from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataServiceImplTest.java with 96% similarity]
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/RestconfDataPutTest.java [moved from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataPutTest.java with 98% similarity]
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/RestconfOperationsGetTest.java [moved from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfOperationsGetTest.java with 98% similarity]
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/RestconfOperationsPostTest.java [moved from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfOperationsPostTest.java with 99% similarity]
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/RestconfYangLibraryVersionGetTest.java [moved from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfImplTest.java with 89% similarity]
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/AbstractInstanceIdentifierTest.java

similarity index 98%
rename from restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfImpl.java
rename to restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/JaxRsRestconf.java
index 9cb1815c9dc167503fc2db751802f2c7bbc38148..169de2d6b64c178c4b32c35adec4265505bbd762 100644 (file)
@@ -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.nb.jaxrs;
 
 import static java.util.Objects.requireNonNull;
 
@@ -65,16 +65,16 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Baseline RESTCONF implementation with JAX-RS.
+ * Baseline RESTCONF implementation with JAX-RS. Interfaces to a {@link RestconfServer}.
  */
 @Path("/")
-public final class RestconfImpl {
-    private static final Logger LOG = LoggerFactory.getLogger(RestconfImpl.class);
+public final class JaxRsRestconf {
+    private static final Logger LOG = LoggerFactory.getLogger(JaxRsRestconf.class);
     private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MMM-dd HH:mm:ss");
 
     private final RestconfServer server;
 
-    public RestconfImpl(final RestconfServer server) {
+    public JaxRsRestconf(final RestconfServer server) {
         this.server = requireNonNull(server);
     }
 
similarity index 94%
rename from restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/JaxRsRestconfCallback.java
rename to restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/JaxRsRestconfCallback.java
index 637820322e7dee69e62f30e0db69cb84c6d83a8f..c57d166db4f5729e89a24cadde3796b320a509e2 100644 (file)
@@ -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.nb.jaxrs;
 
 import static java.util.Objects.requireNonNull;
 
diff --git a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/package-info.java b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/package-info.java
new file mode 100644 (file)
index 0000000..a86d02f
--- /dev/null
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2023 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
+ */
+/**
+ * JAX-RS-based RESTCONF endpoint and its components.
+ */
+package org.opendaylight.restconf.nb.jaxrs;
\ No newline at end of file
index 44c386404a14182b5ed0123a21b0e74fc0970dd1..e47a23566dbd55bec9327504a728c7af6b2a346c 100644 (file)
@@ -11,6 +11,7 @@ import java.util.Set;
 import javax.ws.rs.core.Application;
 import org.opendaylight.mdsal.dom.api.DOMMountPointService;
 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
+import org.opendaylight.restconf.nb.jaxrs.JaxRsRestconf;
 import org.opendaylight.restconf.nb.rfc8040.databind.DatabindProvider;
 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.JsonNormalizedNodeBodyWriter;
 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.JsonPatchStatusBodyWriter;
@@ -19,7 +20,6 @@ import org.opendaylight.restconf.nb.rfc8040.jersey.providers.XmlPatchStatusBodyW
 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.YangSchemaExportBodyWriter;
 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.YinSchemaExportBodyWriter;
 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.errors.RestconfDocumentedExceptionMapper;
-import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfImpl;
 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfSchemaServiceImpl;
 import org.opendaylight.restconf.server.api.RestconfServer;
 
@@ -30,7 +30,7 @@ final class RestconfApplication extends Application {
             final DOMMountPointService mountPointService, final DOMSchemaService domSchemaService) {
         singletons = Set.of(
             new RestconfDocumentedExceptionMapper(databindProvider),
-            new RestconfImpl(server),
+            new JaxRsRestconf(server),
             new RestconfSchemaServiceImpl(domSchemaService, mountPointService));
     }
 
similarity index 90%
rename from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/AbstractRestconfTest.java
rename to restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/AbstractRestconfTest.java
index 8314128edf2195caa4c46c0a1af28952ce35ffa6..50c32f33607cfba85c194d75c440412406aa0559 100644 (file)
@@ -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.nb.jaxrs;
 
 import javax.ws.rs.container.AsyncResponse;
 import javax.ws.rs.core.Response;
@@ -49,11 +49,11 @@ abstract class AbstractRestconfTest extends AbstractJukeboxTest {
     @Captor
     ArgumentCaptor<RestconfDocumentedException> exceptionCaptor;
 
-    RestconfImpl restconf;
+    JaxRsRestconf restconf;
 
     @BeforeEach
     final void setupRestconf() {
-        restconf = new RestconfImpl(new MdsalRestconfServer(() -> DatabindContext.ofModel(modelContext()), dataBroker,
+        restconf = new JaxRsRestconf(new MdsalRestconfServer(() -> DatabindContext.ofModel(modelContext()), dataBroker,
             rpcService, actionService, mountPointService));
     }
 
similarity index 85%
rename from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/Netconf799Test.java
rename to restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/Netconf799Test.java
index c4e957781cff9bc7513634b8c5caece3aed97ad9..bee242b097bd42edb0b2632cbb3f2dd1aa01d95d 100644 (file)
@@ -5,10 +5,10 @@
  * 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.nb.jaxrs;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doReturn;
@@ -18,12 +18,12 @@ import javax.ws.rs.container.AsyncResponse;
 import javax.ws.rs.core.MultivaluedHashMap;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Captor;
 import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
+import org.mockito.junit.jupiter.MockitoExtension;
 import org.opendaylight.mdsal.dom.api.DOMActionService;
 import org.opendaylight.mdsal.dom.api.DOMDataBroker;
 import org.opendaylight.mdsal.dom.api.DOMMountPointService;
@@ -37,8 +37,8 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdent
 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute;
 
-@RunWith(MockitoJUnitRunner.StrictStubs.class)
-public class Netconf799Test extends AbstractInstanceIdentifierTest {
+@ExtendWith(MockitoExtension.class)
+class Netconf799Test extends AbstractInstanceIdentifierTest {
     private static final QName OUTPUT_QNAME = QName.create(CONT_QNAME, "output");
 
     @Mock
@@ -57,12 +57,12 @@ public class Netconf799Test extends AbstractInstanceIdentifierTest {
     private ArgumentCaptor<Response> captor;
 
     @Test
-    public void testInvokeAction() {
+    void testInvokeAction() {
         doReturn(Futures.immediateFuture(new SimpleDOMActionResult(
             Builders.containerBuilder().withNodeIdentifier(NodeIdentifier.create(OUTPUT_QNAME)).build())))
             .when(actionService).invokeAction(eq(Absolute.of(CONT_QNAME, CONT1_QNAME, RESET_QNAME)), any(), any());
 
-        final var restconf = new RestconfImpl(new MdsalRestconfServer(
+        final var restconf = new JaxRsRestconf(new MdsalRestconfServer(
             () -> DatabindContext.ofModel(IID_SCHEMA), dataBroker, rpcService, actionService, mountPointService));
         doReturn(new MultivaluedHashMap<>()).when(uriInfo).getQueryParameters();
         doReturn(true).when(asyncResponse).resume(captor.capture());
similarity index 96%
rename from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/Netconf822Test.java
rename to restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/Netconf822Test.java
index 643ed2a45368d09bedf94488c10e5edf0fc3d3e0..ae746bfaffefe2d7c05cd533418231d5ad23ee2c 100644 (file)
@@ -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.nb.jaxrs;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
similarity index 98%
rename from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataDeleteTest.java
rename to restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/RestconfDataDeleteTest.java
index 68b121addcc59e3bc3c35d2329ec0a0c4be82a91..dddd4ab45bc19ebc9f995fc09ea0849a8a3f7df0 100644 (file)
@@ -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.nb.jaxrs;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.mockito.ArgumentMatchers.any;
similarity index 99%
rename from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataGetTest.java
rename to restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/RestconfDataGetTest.java
index b8155a397c1912f4c1b4da85faaed0ca9af72f37..e154f9ea972969ddb1cd9f1bb1d1392a775ee04c 100644 (file)
@@ -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.nb.jaxrs;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertInstanceOf;
similarity index 99%
rename from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataPatchTest.java
rename to restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/RestconfDataPatchTest.java
index 1a9b953ebcff9961601efa077a00cdcb9fd42b96..9c79d786bf0857b6e0191d8ab5308e7a98234bae 100644 (file)
@@ -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.nb.jaxrs;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
similarity index 96%
rename from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataServiceImplTest.java
rename to restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/RestconfDataPostTest.java
index a47b61c7071bfc4388e270eaa2e2c84b811befec..2314377cbfab957f21b675ed99b2b7c1e55b3e1a 100644 (file)
@@ -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.nb.jaxrs;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.mockito.Mockito.doNothing;
@@ -27,7 +27,7 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdent
 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 
 @ExtendWith(MockitoExtension.class)
-class RestconfDataServiceImplTest extends AbstractRestconfTest {
+class RestconfDataPostTest extends AbstractRestconfTest {
     @Mock
     private DOMDataTreeReadWriteTransaction tx;
 
similarity index 98%
rename from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataPutTest.java
rename to restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/RestconfDataPutTest.java
index 591d51fa4e226cd2557ee537b67fc7c6020ca7f2..87733a661b709a93c806ea352126eae836a7b220 100644 (file)
@@ -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.nb.jaxrs;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.mockito.ArgumentMatchers.any;
similarity index 98%
rename from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfOperationsGetTest.java
rename to restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/RestconfOperationsGetTest.java
index 3bf40c1fa400bd31673756d705ac72ccf7165793..7907bfd2b5d2d5bf6b182326965ce4734808da15 100644 (file)
@@ -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.nb.jaxrs;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.mockito.ArgumentMatchers.any;
@@ -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.nb.jaxrs;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertInstanceOf;
similarity index 89%
rename from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfImplTest.java
rename to restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/RestconfYangLibraryVersionGetTest.java
index c2f43a845073580e71d7fbc2bcf1e6a206c87090..1a6025bf44ccf54bf865c125e1a59d0097dd57af 100644 (file)
@@ -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.nb.jaxrs;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertInstanceOf;
@@ -24,7 +24,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;
 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
 
 @ExtendWith(MockitoExtension.class)
-class RestconfImplTest {
+class RestconfYangLibraryVersionGetTest {
     @Mock
     private DOMDataBroker dataBroker;
     @Mock
@@ -37,7 +37,7 @@ class RestconfImplTest {
     @Test
     void testLibraryVersion() {
         final var context = DatabindContext.ofModel(YangParserTestUtils.parseYangResourceDirectory("/restconf/impl"));
-        final var restconfImpl = new RestconfImpl(new MdsalRestconfServer(() -> context, dataBroker, rpcService,
+        final var restconfImpl = new JaxRsRestconf(new MdsalRestconfServer(() -> context, dataBroker, rpcService,
             actionService, mountPointService));
         final var libraryVersion = assertInstanceOf(LeafNode.class, restconfImpl.yangLibraryVersionGET().data());
         assertEquals("2019-01-04", libraryVersion.body());
index 2255773d1c8fefd9e830e1ed8ceb818a7e65465c..324acbdb1ccb9b526e45571744603dd4bf9e3e13 100644 (file)
@@ -10,8 +10,6 @@ package org.opendaylight.restconf.nb.rfc8040;
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.nio.charset.StandardCharsets;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.QNameModule;
 import org.opendaylight.yangtools.yang.common.Revision;
@@ -51,17 +49,8 @@ public abstract class AbstractInstanceIdentifierTest {
     protected static final QName MY_LEAF11_QNAME = QName.create(PATCH_CONT_QNAME, "my-leaf11");
     protected static final QName MY_LEAF12_QNAME = QName.create(PATCH_CONT_QNAME, "my-leaf12");
 
-    protected static EffectiveModelContext IID_SCHEMA;
-
-    @BeforeClass
-    public static final void beforeClass() {
-        IID_SCHEMA = YangParserTestUtils.parseYangResourceDirectory("/instanceidentifier/yang");
-    }
-
-    @AfterClass
-    public static final void afterClass() {
-        IID_SCHEMA = null;
-    }
+    protected static final EffectiveModelContext IID_SCHEMA =
+        YangParserTestUtils.parseYangResourceDirectory("/instanceidentifier/yang");
 
     protected static final InputStream stringInputStream(final String str) {
         return new ByteArrayInputStream(str.getBytes(StandardCharsets.UTF_8));