import java.util.Optional;
import org.junit.Before;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.opendaylight.netconf.dom.api.NetconfDataTreeService;
import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
import org.opendaylight.restconf.nb.rfc8040.AbstractJukeboxTest;
+import org.opendaylight.restconf.nb.rfc8040.databind.DatabindContext;
+import org.opendaylight.restconf.nb.rfc8040.databind.DatabindProvider;
import org.opendaylight.restconf.nb.rfc8040.rests.transactions.MdsalRestconfStrategy;
import org.opendaylight.restconf.nb.rfc8040.rests.transactions.NetconfRestconfStrategy;
import org.opendaylight.yangtools.yang.common.ErrorTag;
@RunWith(MockitoJUnitRunner.StrictStubs.class)
public class MdsalRestconfServerTest extends AbstractJukeboxTest {
+ private static DatabindProvider DATABIND_PROVIDER;
+
@Mock
private DOMMountPointService mountPointService;
@Mock
private MdsalRestconfServer server;
+ @BeforeClass
+ public static void setupDatabind() {
+ DATABIND_PROVIDER = () -> DatabindContext.ofModel(JUKEBOX_SCHEMA);
+ }
+
@Before
public void before() {
- server = new MdsalRestconfServer(dataBroker, rpcService, mountPointService);
+ server = new MdsalRestconfServer(DATABIND_PROVIDER, dataBroker, rpcService, mountPointService);
doReturn(Optional.of(rpcService)).when(mountPoint).getService(DOMRpcService.class);
}