X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fyanglib%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fyanglib%2Fimpl%2FYangLibServiceImplTest.java;h=c6848102d7ffe58d165a5e6eda8bd82786b8e0f2;hb=a1d28abf688f9e6839b11cce5433e179c9c85169;hp=add8d67e699f9868c69b729fdfc624265ec2c0b3;hpb=86c0fca79e0f3f10e202a3824f3345c9f8c1a8ba;p=netconf.git diff --git a/netconf/yanglib/src/test/java/org/opendaylight/yanglib/impl/YangLibServiceImplTest.java b/netconf/yanglib/src/test/java/org/opendaylight/yanglib/impl/YangLibServiceImplTest.java index add8d67e69..c6848102d7 100644 --- a/netconf/yanglib/src/test/java/org/opendaylight/yanglib/impl/YangLibServiceImplTest.java +++ b/netconf/yanglib/src/test/java/org/opendaylight/yanglib/impl/YangLibServiceImplTest.java @@ -14,13 +14,14 @@ import static org.mockito.Matchers.eq; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; -import com.google.common.base.MoreObjects; -import com.google.common.util.concurrent.CheckedFuture; +import com.google.common.base.MoreObjects.ToStringHelper; import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import org.junit.Test; +import org.opendaylight.yangtools.yang.common.Revision; import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier; import org.opendaylight.yangtools.yang.model.repo.api.SchemaRepository; import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException; @@ -29,20 +30,19 @@ import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource; public class YangLibServiceImplTest { - private final static String TEST_OUTPUT_STRING = "hello world"; + private static final String TEST_OUTPUT_STRING = "hello world"; @Test public void testSchema() throws SchemaSourceException { final SchemaRepository schemaRepository = mock(SchemaRepository.class); - final YangLibServiceImpl yangLibService = new YangLibServiceImpl(); - yangLibService.setSchemaRepository(schemaRepository); + final YangLibServiceImpl yangLibService = new YangLibServiceImpl(schemaRepository); - final SourceIdentifier sourceIdentifier = RevisionSourceIdentifier.create("name", "2016-01-01"); + final SourceIdentifier sourceIdentifier = RevisionSourceIdentifier.create("name", Revision.of("2016-01-01")); final YangTextSchemaSource yangTextSchemaSource = new YangTextSchemaSource(sourceIdentifier) { @Override - protected MoreObjects.ToStringHelper addToStringAttributes(MoreObjects.ToStringHelper toStringHelper) { + protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) { return null; } @@ -52,8 +52,7 @@ public class YangLibServiceImplTest { } }; - final CheckedFuture sourceFuture = - Futures.immediateCheckedFuture(yangTextSchemaSource); + final ListenableFuture sourceFuture = Futures.immediateFuture(yangTextSchemaSource); doReturn(sourceFuture).when(schemaRepository).getSchemaSource(any(SourceIdentifier.class), eq(YangTextSchemaSource.class));