X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fschema%2Fprovider%2Fimpl%2FRemoteYangTextSourceProviderImplTest.java;fp=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fschema%2Fprovider%2Fimpl%2FRemoteYangTextSourceProviderImplTest.java;h=a63be0aa00e752d44d3704b8d5c30d8105cfcb10;hb=7526de25301597d670657400b541b10455311fbe;hp=85fe58584bfd3b3fc624329d7aefb489b608eebc;hpb=9917911b1a492b5f9fbeef1591569f7fc4a80f68;p=controller.git diff --git a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/schema/provider/impl/RemoteYangTextSourceProviderImplTest.java b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/schema/provider/impl/RemoteYangTextSourceProviderImplTest.java index 85fe58584b..a63be0aa00 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/schema/provider/impl/RemoteYangTextSourceProviderImplTest.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/schema/provider/impl/RemoteYangTextSourceProviderImplTest.java @@ -22,10 +22,11 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; +import org.opendaylight.yangtools.yang.model.api.source.SourceIdentifier; +import org.opendaylight.yangtools.yang.model.api.source.YangTextSource; import org.opendaylight.yangtools.yang.model.repo.api.SchemaRepository; import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException; -import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier; -import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource; +import org.opendaylight.yangtools.yang.model.spi.source.DelegatedYangTextSource; import scala.concurrent.Await; import scala.concurrent.duration.FiniteDuration; @@ -46,24 +47,24 @@ public class RemoteYangTextSourceProviderImplTest { @Test public void testGetExistingYangTextSchemaSource() throws Exception { - var schemaSource = YangTextSchemaSource.delegateForCharSource(ID, CharSource.wrap("Test source.")); + var schemaSource = new DelegatedYangTextSource(ID, CharSource.wrap("Test source.")); doReturn(Futures.immediateFuture(schemaSource)).when(mockedLocalRepository) - .getSchemaSource(ID, YangTextSchemaSource.class); + .getSchemaSource(ID, YangTextSource.class); var retrievedSourceFuture = remoteRepository.getYangTextSchemaSource(ID); assertTrue(retrievedSourceFuture.isCompleted()); var resultSchemaSource = Await.result(retrievedSourceFuture, FiniteDuration.Zero()).getRepresentation(); - assertEquals(resultSchemaSource.getIdentifier(), schemaSource.getIdentifier()); + assertEquals(resultSchemaSource.sourceId(), schemaSource.sourceId()); assertEquals(resultSchemaSource.read(), schemaSource.read()); } @Test public void testGetNonExistentYangTextSchemaSource() throws Exception { - final var exception = new SchemaSourceException("Source is not provided"); + final var exception = new SchemaSourceException(ID, "Source is not provided"); doReturn(Futures.immediateFailedFuture(exception)).when(mockedLocalRepository) - .getSchemaSource(ID, YangTextSchemaSource.class); + .getSchemaSource(ID, YangTextSource.class); var retrievedSourceFuture = remoteRepository.getYangTextSchemaSource(ID); assertTrue(retrievedSourceFuture.isCompleted());