Migrate yang-repo-spi to JUnit5 12/106912/4
authormatus.matok <matus.matok@pantheon.tech>
Thu, 13 Jul 2023 09:27:10 +0000 (11:27 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 17 Oct 2023 07:57:58 +0000 (09:57 +0200)
Migrated all tests to use JUnit5 Assertions, using
openrewrite:rewrite-testing-frameworks.

JIRA: YANGTOOLS-1521
Change-Id: I99202bffab5035110a3c2b3d9228d64d933c26c3
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-repo-spi/pom.xml
yang/yang-repo-spi/src/test/java/org/opendaylight/yangtools/yang/model/repo/spi/GuavaSchemaSourceCacheTest.java
yang/yang-repo-spi/src/test/java/org/opendaylight/yangtools/yang/model/repo/spi/PotentialSchemaSourceTest.java
yang/yang-repo-spi/src/test/java/org/opendaylight/yangtools/yang/model/repo/spi/RefcountedRegistrationTest.java
yang/yang-repo-spi/src/test/java/org/opendaylight/yangtools/yang/model/repo/spi/SchemaSourceTransformerTest.java
yang/yang-repo-spi/src/test/java/org/opendaylight/yangtools/yang/model/repo/spi/SoftSchemaSourceCacheTest.java

index bb75b187687b78b111f6a7b599f5051ffc0f6ec6..e4b4aacd143570ad3ac14ca6d5ad777a5f5f5723 100644 (file)
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-repo-api</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>mockito-configuration</artifactId>
+        </dependency>
     </dependencies>
 </project>
index 8853b4a8cdb8fb4ef26388ea293cd239345acbd2..0b5f885bbae5cab232aa73feea793ec1b5edf4e9 100644 (file)
@@ -7,66 +7,60 @@
  */
 package org.opendaylight.yangtools.yang.model.repo.spi;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 
 import com.google.common.base.MoreObjects.ToStringHelper;
-import java.io.Reader;
 import java.io.StringReader;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
-import org.junit.Before;
-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.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
+import org.mockito.junit.jupiter.MockitoExtension;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
 import org.opendaylight.yangtools.yang.model.repo.api.YangSchemaSourceRepresentation;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
 
 @Deprecated
-@RunWith(MockitoJUnitRunner.StrictStubs.class)
-public class GuavaSchemaSourceCacheTest {
-    public static final Class<YangSchemaSourceRepresentation> REPRESENTATION = YangSchemaSourceRepresentation.class;
-    public static final long LIFETIME = 1000L;
-    public static final TimeUnit UNITS = TimeUnit.MILLISECONDS;
+@ExtendWith(MockitoExtension.class)
+class GuavaSchemaSourceCacheTest {
+    private static final Class<YangSchemaSourceRepresentation> REPRESENTATION = YangSchemaSourceRepresentation.class;
+    private static final long LIFETIME = 1000L;
+    private static final TimeUnit UNITS = TimeUnit.MILLISECONDS;
 
     @Mock
     public SchemaSourceRegistry registry;
     @Mock
     public SchemaSourceRegistration<?> registration;
 
-    @Before
-    public void setUp() {
-        doNothing().when(registration).close();
-        doReturn(registration).when(registry).registerSchemaSource(any(SchemaSourceProvider.class),
-            any(PotentialSchemaSource.class));
-    }
-
     @Test
-    public void inMemorySchemaSourceCacheTest1() {
+    void inMemorySchemaSourceCacheTest1() {
         try (var cache = GuavaSchemaSourceCache.createSoftCache(registry, REPRESENTATION)) {
             assertNotNull(cache);
         }
     }
 
     @Test
-    public void inMemorySchemaSourceCacheTest2() {
+    void inMemorySchemaSourceCacheTest2() {
         try (var cache = GuavaSchemaSourceCache.createSoftCache(registry, REPRESENTATION, LIFETIME, UNITS)) {
             assertNotNull(cache);
         }
     }
 
     @Test
-    public void inMemorySchemaSourceCacheOfferAndGetSourcestest() throws Exception {
+    void inMemorySchemaSourceCacheOfferAndGetSourcestest() throws Exception {
+        doNothing().when(registration).close();
+        doReturn(registration).when(registry).registerSchemaSource(any(), any());
+
         try (var cache = GuavaSchemaSourceCache.createSoftCache(registry, REPRESENTATION)) {
-            final String content = "content";
-            final YangTextSchemaSource source = new TestingYangSource("test", "2012-12-12", content);
+            final var content = "content";
+            final var source = new TestingYangSource("test", "2012-12-12", content);
             cache.offer(source);
             final var sourceIdentifier = new SourceIdentifier("test", "2012-12-12");
             final var checkedSource = cache .getSource(sourceIdentifier);
@@ -78,21 +72,24 @@ public class GuavaSchemaSourceCacheTest {
     }
 
     @Test
-    public void inMemorySchemaSourceCacheNullGetSourcestest() throws Exception {
+    void inMemorySchemaSourceCacheNullGetSourcestest() throws Exception {
         try (var cache = GuavaSchemaSourceCache.createSoftCache(registry, REPRESENTATION)) {
             final var sourceIdentifier = new SourceIdentifier("test", "2012-12-12");
             final var checkedSource = cache.getSource(sourceIdentifier);
             assertNotNull(checkedSource);
-            assertThrows(ExecutionException.class, () -> checkedSource.get());
+            assertThrows(ExecutionException.class, checkedSource::get);
         }
     }
 
     @Test
-    public void inMemorySchemaSourceCache3test() throws InterruptedException, ExecutionException {
+    void inMemorySchemaSourceCache3test() throws InterruptedException, ExecutionException {
+        doNothing().when(registration).close();
+        doReturn(registration).when(registry).registerSchemaSource(any(), any());
+
         try (var cache1 = GuavaSchemaSourceCache.createSoftCache(registry, REPRESENTATION)) {
             try (var cache2 = GuavaSchemaSourceCache.createSoftCache(registry, REPRESENTATION, LIFETIME, UNITS)) {
-                final String content = "content";
-                final YangTextSchemaSource source = new TestingYangSource("test", "2012-12-12", content);
+                final var content = "content";
+                final var source = new TestingYangSource("test", "2012-12-12", content);
                 cache1.offer(source);
                 cache2.offer(source);
 
@@ -116,7 +113,7 @@ public class GuavaSchemaSourceCacheTest {
         }
 
         @Override
-        public Reader openStream() {
+        public StringReader openStream() {
             return new StringReader(content);
         }
 
index 10d28f1fb459fcc5c3c1a5aca40c2801151589de..d0435649d1d8b0440f3a86fcbe59ef0db5688f88 100644 (file)
@@ -7,21 +7,20 @@
  */
 package org.opendaylight.yangtools.yang.model.repo.spi;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertThrows;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.junit.MockitoJUnitRunner;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.junit.jupiter.MockitoExtension;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
 import org.opendaylight.yangtools.yang.model.repo.api.YangSchemaSourceRepresentation;
 
-@RunWith(MockitoJUnitRunner.StrictStubs.class)
-public class PotentialSchemaSourceTest {
+@ExtendWith(MockitoExtension.class)
+class PotentialSchemaSourceTest {
     private interface TestSchemaSourceRepresentation extends YangSchemaSourceRepresentation {
         @Override
         default Class<TestSchemaSourceRepresentation> getType() {
@@ -35,8 +34,8 @@ public class PotentialSchemaSourceTest {
     @SuppressWarnings("exports")
     public PotentialSchemaSource<TestSchemaSourceRepresentation> same;
 
-    @Before
-    public void before() {
+    @BeforeEach
+    void before() {
         source = PotentialSchemaSource.create(sourceIdentifier, TestSchemaSourceRepresentation.class,
             PotentialSchemaSource.Costs.LOCAL_IO.getValue());
         same = PotentialSchemaSource.create(source.getSourceIdentifier(), source.getRepresentation(),
@@ -44,24 +43,24 @@ public class PotentialSchemaSourceTest {
     }
 
     @Test
-    public void testNegativeCost() {
+    void testNegativeCost() {
         assertThrows(IllegalArgumentException.class,
             () -> PotentialSchemaSource.create(sourceIdentifier, TestSchemaSourceRepresentation.class, -1));
     }
 
     @Test
-    public void testMethods() {
+    void testMethods() {
         assertEquals(PotentialSchemaSource.Costs.LOCAL_IO.getValue(), source.getCost());
         assertSame(sourceIdentifier, source.getSourceIdentifier());
         assertSame(TestSchemaSourceRepresentation.class, source.getRepresentation());
         assertEquals(same.hashCode(), source.hashCode());
-        assertFalse(source.equals(null));
-        assertTrue(source.equals(source));
-        assertTrue(source.equals(same));
+        assertNotEquals(null, source);
+        assertEquals(source, source);
+        assertEquals(source, same);
     }
 
     @Test
-    public void testIntern() {
+    void testIntern() {
         assertSame(source, source.cachedReference());
         assertSame(source, same.cachedReference());
     }
index ec8f6bdf0f763b6f0437312eba9e9218b09680e4..a3124d2f55d0a09e0dd0b38265b27aa79e5ff5ca 100644 (file)
@@ -7,49 +7,40 @@
  */
 package org.opendaylight.yangtools.yang.model.repo.spi;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
 
-import org.junit.Before;
-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.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
+import org.mockito.junit.jupiter.MockitoExtension;
 
-@RunWith(MockitoJUnitRunner.class)
-public class RefcountedRegistrationTest {
+@ExtendWith(MockitoExtension.class)
+class RefcountedRegistrationTest {
     @Mock
-    public SchemaSourceRegistration<?> reg;
-
-    @Before
-    public void before() {
-        doNothing().when(reg).close();
-    }
+    private SchemaSourceRegistration<?> reg;
 
     @Test
-    public void refcountDecTrue() {
-        final RefcountedRegistration ref = new RefcountedRegistration(reg);
+    void refcountDecTrue() {
+        final var ref = new RefcountedRegistration(reg);
+        doNothing().when(reg).close();
         assertTrue(ref.decRef());
-        verify(reg, times(1)).close();
     }
 
     @Test
-    public void refcountIncDecFalse() {
-        final RefcountedRegistration ref = new RefcountedRegistration(reg);
+    void refcountIncDecFalse() {
+        final var ref = new RefcountedRegistration(reg);
         ref.incRef();
         assertFalse(ref.decRef());
-        verify(reg, times(0)).close();
     }
 
     @Test
-    public void refcountIncDecTrue() {
-        final RefcountedRegistration ref = new RefcountedRegistration(reg);
+    void refcountIncDecTrue() {
+        final var ref = new RefcountedRegistration(reg);
         ref.incRef();
         assertFalse(ref.decRef());
+        doNothing().when(reg).close();
         assertTrue(ref.decRef());
-        verify(reg, times(1)).close();
     }
 }
index 8fe0350d0f96fcbcf2699e4954775ad4a8af27d3..f7d198dfa839647d34d7ea5fda3f74387ea3483d 100644 (file)
@@ -7,19 +7,18 @@
  */
 package org.opendaylight.yangtools.yang.model.repo.spi;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.Mockito.mock;
 
 import com.google.common.util.concurrent.AsyncFunction;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
 import java.util.Arrays;
-import java.util.concurrent.Future;
-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.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
+import org.mockito.junit.jupiter.MockitoExtension;
 import org.opendaylight.yangtools.yang.model.repo.api.EffectiveModelContextFactory;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaContextFactoryConfiguration;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaRepository;
@@ -29,8 +28,8 @@ import org.opendaylight.yangtools.yang.model.repo.api.YangSchemaSourceRepresenta
 import org.opendaylight.yangtools.yang.model.repo.api.YinXmlSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.spi.PotentialSchemaSource.Costs;
 
-@RunWith(MockitoJUnitRunner.class)
-public class SchemaSourceTransformerTest {
+@ExtendWith(MockitoExtension.class)
+class SchemaSourceTransformerTest {
     public static final Class<YangSchemaSourceRepresentation> SRC_CLASS = YangSchemaSourceRepresentation.class;
     public static final Class<YinXmlSchemaSource> DST_CLASS = YinXmlSchemaSource.class;
 
@@ -46,7 +45,7 @@ public class SchemaSourceTransformerTest {
     public SchemaSourceTransformer<YangSchemaSourceRepresentation, YinXmlSchemaSource> schema;
 
     @Test
-    public void schemaSourceTransformerTest() {
+    void schemaSourceTransformerTest() {
         schema = new SchemaSourceTransformer<>(
                 provider, SchemaSourceTransformerTest.SRC_CLASS, consumer,
                 SchemaSourceTransformerTest.DST_CLASS, function);
@@ -54,49 +53,49 @@ public class SchemaSourceTransformerTest {
     }
 
     @Test
-    public void schemaSourceTransformerGetSourceTest() {
-        final Provider p = new Provider();
-        final Registrator reg = new Registrator(p, SchemaSourceTransformerTest.SRC_CLASS,
+    void schemaSourceTransformerGetSourceTest() {
+        final var p = new Provider();
+        final var reg = new Registrator(p, SchemaSourceTransformerTest.SRC_CLASS,
                 PotentialSchemaSource.Costs.IMMEDIATE);
-        final SourceIdentifier sourceIdentifier = new SourceIdentifier("source");
+        final var sourceIdentifier = new SourceIdentifier("source");
         reg.register(sourceIdentifier);
         schema = new SchemaSourceTransformer<>(p,
                 SchemaSourceTransformerTest.SRC_CLASS, consumer, SchemaSourceTransformerTest.DST_CLASS,
                 function);
-        final SchemaSourceProvider<YinXmlSchemaSource> prov = schema;
-        final Future<? extends YinXmlSchemaSource> source = prov.getSource(sourceIdentifier);
+        final var prov = schema;
+        final var source = prov.getSource(sourceIdentifier);
         assertNotNull(source);
         source.cancel(true);
         assertTrue(source.isDone());
     }
 
     @Test
-    public void schemaSourceRegAndUnregSchemaSourceTest() {
-        final SourceIdentifier sourceIdentifier = new SourceIdentifier("source");
-        final Foo<YangSchemaSourceRepresentation> foo = new Foo<>(sourceIdentifier,
+    void schemaSourceRegAndUnregSchemaSourceTest() {
+        final var sourceIdentifier = new SourceIdentifier("source");
+        final var foo = new Foo<>(sourceIdentifier,
                 SchemaSourceTransformerTest.SRC_CLASS,
                 PotentialSchemaSource.Costs.COMPUTATION);
-        final Provider p = new Provider();
+        final var p = new Provider();
 
-        final Registrator reg = new Registrator(p, SchemaSourceTransformerTest.SRC_CLASS,
+        final var reg = new Registrator(p, SchemaSourceTransformerTest.SRC_CLASS,
                 PotentialSchemaSource.Costs.IMMEDIATE);
         reg.register(sourceIdentifier);
 
-        final Consumer c = new Consumer();
+        final var c = new Consumer();
         schema = new SchemaSourceTransformer<>(p, SchemaSourceTransformerTest.SRC_CLASS, c,
             SchemaSourceTransformerTest.DST_CLASS, function);
 
-        final SchemaSourceListener listener = schema;
+        final var listener = schema;
         p.registerSchemaSourceListener(listener);
 
-        final PotentialSchemaSource<?>[] potList = { foo.getPotentialSchemSource() };
-        final Iterable<PotentialSchemaSource<?>> sources = Arrays.asList(potList);
+        final var potList = new PotentialSchemaSource<?>[]{ foo.getPotentialSchemSource() };
+        final var sources = Arrays.asList(potList);
         listener.schemaSourceRegistered(sources);
-        final ListenableFuture<YinXmlSchemaSource> source = schema.getSource(sourceIdentifier);
+        final var source = schema.getSource(sourceIdentifier);
         assertNotNull(source);
 
         listener.schemaSourceUnregistered(foo.getPotentialSchemSource());
-        final ListenableFuture<YinXmlSchemaSource> source2 = schema.getSource(sourceIdentifier);
+        final var source2 = schema.getSource(sourceIdentifier);
         assertNotNull(source2);
     }
 
index 604143db50285af2dcf861c3bc730a173aa8a4d8..2dae5fb1a71fd19216b063c1919f71a65f12ba54 100644 (file)
@@ -7,58 +7,49 @@
  */
 package org.opendaylight.yangtools.yang.model.repo.spi;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 
 import com.google.common.base.MoreObjects.ToStringHelper;
-import java.io.Reader;
 import java.io.StringReader;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import org.junit.Before;
-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.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
+import org.mockito.junit.jupiter.MockitoExtension;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
 import org.opendaylight.yangtools.yang.model.repo.api.YangSchemaSourceRepresentation;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
 
-@RunWith(MockitoJUnitRunner.StrictStubs.class)
-public class SoftSchemaSourceCacheTest {
-    public static final Class<YangSchemaSourceRepresentation> REPRESENTATION = YangSchemaSourceRepresentation.class;
-    public static final long LIFETIME = 1000L;
-    public static final TimeUnit UNITS = TimeUnit.MILLISECONDS;
+@ExtendWith(MockitoExtension.class)
+class SoftSchemaSourceCacheTest {
+    private static final Class<YangSchemaSourceRepresentation> REPRESENTATION = YangSchemaSourceRepresentation.class;
 
     @Mock
-    public SchemaSourceRegistry registry;
+    private SchemaSourceRegistry registry;
     @Mock
-    public SchemaSourceRegistration<?> registration;
-
-    @Before
-    public void setUp() {
-        doNothing().when(registration).close();
-        doReturn(registration).when(registry).registerSchemaSource(any(SchemaSourceProvider.class),
-            any(PotentialSchemaSource.class));
-    }
+    private SchemaSourceRegistration<?> registration;
 
     @Test
-    public void inMemorySchemaSourceCacheTest() {
+    void inMemorySchemaSourceCacheTest() {
         try (var cache = new SoftSchemaSourceCache<>(registry, REPRESENTATION)) {
             assertNotNull(cache);
         }
     }
 
     @Test
-    public void inMemorySchemaSourceCacheOfferAndGetSourcestest() throws Exception {
+    void inMemorySchemaSourceCacheOfferAndGetSourcestest() throws Exception {
+        doNothing().when(registration).close();
+        doReturn(registration).when(registry).registerSchemaSource(any(), any());
+
         try (var cache = new SoftSchemaSourceCache<>(registry, REPRESENTATION)) {
-            final String content = "content";
-            final YangTextSchemaSource source = new TestingYangSource("test", "2012-12-12", content);
+            final var content = "content";
+            final var source = new TestingYangSource("test", "2012-12-12", content);
             cache.offer(source);
             final var sourceIdentifier = new SourceIdentifier("test", "2012-12-12");
             final var checkedSource = cache .getSource(sourceIdentifier);
@@ -70,21 +61,24 @@ public class SoftSchemaSourceCacheTest {
     }
 
     @Test
-    public void inMemorySchemaSourceCacheNullGetSourcestest() throws Exception {
+    void inMemorySchemaSourceCacheNullGetSourcestest() throws Exception {
         try (var cache = new SoftSchemaSourceCache<>(registry, REPRESENTATION)) {
             final var sourceIdentifier = new SourceIdentifier("test", "2012-12-12");
             final var checkedSource = cache.getSource(sourceIdentifier);
             assertNotNull(checkedSource);
-            assertThrows(ExecutionException.class, () -> checkedSource.get());
+            assertThrows(ExecutionException.class, checkedSource::get);
         }
     }
 
     @Test
-    public void inMemorySchemaSourceCache3test() throws InterruptedException, ExecutionException {
+    void inMemorySchemaSourceCache3test() throws InterruptedException, ExecutionException {
+        doNothing().when(registration).close();
+        doReturn(registration).when(registry).registerSchemaSource(any(), any());
+
         try (var cache1 = new SoftSchemaSourceCache<>(registry, REPRESENTATION)) {
             try (var cache2 = new SoftSchemaSourceCache<>(registry, REPRESENTATION)) {
-                final String content = "content";
-                final YangTextSchemaSource source = new TestingYangSource("test", "2012-12-12", content);
+                final var content = "content";
+                final var source = new TestingYangSource("test", "2012-12-12", content);
                 cache1.offer(source);
                 cache2.offer(source);
 
@@ -108,7 +102,7 @@ public class SoftSchemaSourceCacheTest {
         }
 
         @Override
-        public Reader openStream() {
+        public StringReader openStream() {
             return new StringReader(content);
         }