X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=restconf%2Frestconf-nb%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Frestconf%2Fnb%2Frfc8040%2Fjersey%2Fproviders%2Ferrors%2FRestconfDocumentedExceptionMapperTest.java;fp=restconf%2Frestconf-nb%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Frestconf%2Fnb%2Frfc8040%2Fjersey%2Fproviders%2Ferrors%2FRestconfDocumentedExceptionMapperTest.java;h=78f64857ea94f4a7f3a5826fad8247a7d93c5fb9;hb=32013f8d8fefcb6f5e70f6b809e7ee5291d732a6;hp=c537e6cc460119a29785faa1d224565480416fea;hpb=8365ae3952c207c6b78ff45125706f7aae90d237;p=netconf.git diff --git a/restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/errors/RestconfDocumentedExceptionMapperTest.java b/restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/errors/RestconfDocumentedExceptionMapperTest.java index c537e6cc46..78f64857ea 100644 --- a/restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/errors/RestconfDocumentedExceptionMapperTest.java +++ b/restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/errors/RestconfDocumentedExceptionMapperTest.java @@ -30,7 +30,7 @@ import org.junit.runners.Parameterized.Parameters; import org.opendaylight.restconf.common.errors.RestconfDocumentedException; import org.opendaylight.restconf.common.errors.RestconfError; import org.opendaylight.restconf.nb.rfc8040.MediaTypes; -import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler; +import org.opendaylight.restconf.nb.rfc8040.databind.DatabindContext; import org.opendaylight.yangtools.yang.common.ErrorTag; import org.opendaylight.yangtools.yang.common.ErrorType; import org.opendaylight.yangtools.yang.common.QName; @@ -38,7 +38,6 @@ import org.opendaylight.yangtools.yang.common.QNameModule; import org.opendaylight.yangtools.yang.common.Revision; import org.opendaylight.yangtools.yang.common.XMLNamespace; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; -import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils; import org.skyscreamer.jsonassert.JSONAssert; @@ -54,13 +53,10 @@ public class RestconfDocumentedExceptionMapperTest { @BeforeClass public static void setupExceptionMapper() { - final SchemaContext schemaContext = YangParserTestUtils.parseYangResources( + final var schemaContext = YangParserTestUtils.parseYangResources( RestconfDocumentedExceptionMapperTest.class, "/restconf/impl/ietf-restconf@2017-01-26.yang", "/instanceidentifier/yang/instance-identifier-patch-module.yang"); - final SchemaContextHandler schemaContextHandler = mock(SchemaContextHandler.class); - doReturn(schemaContext).when(schemaContextHandler).get(); - - exceptionMapper = new RestconfDocumentedExceptionMapper(schemaContextHandler); + exceptionMapper = new RestconfDocumentedExceptionMapper(() -> DatabindContext.ofModel(schemaContext)); } /**