@@ -37,7 +37,7 @@ import org.scalatestplus.mockito.MockitoSugar
37
37
import scala .util .Random
38
38
39
39
@ RunWith (classOf [JUnitRunner ])
40
- class AsyncStreamGraphTests
40
+ class MongoDBAsyncStreamGraphTests
41
41
extends FlatSpec
42
42
with Matchers
43
43
with ScalaFutures
@@ -47,13 +47,13 @@ class AsyncStreamGraphTests
47
47
48
48
implicit val mat = ActorMaterializer ()
49
49
50
- behavior of " AsyncStreamSource "
50
+ behavior of " MongoDBAsyncStreamSource "
51
51
52
52
it should " read all bytes" in {
53
53
val bytes = randomBytes(4000 )
54
54
val asyncStream = AsyncStreamHelper .toAsyncInputStream(bytes)
55
55
56
- val readStream = AsyncStreamSource (asyncStream, 42 ).runWith(StreamConverters .asInputStream())
56
+ val readStream = MongoDBAsyncStreamSource (asyncStream, 42 ).runWith(StreamConverters .asInputStream())
57
57
val readBytes = IOUtils .toByteArray(readStream)
58
58
59
59
bytes shouldBe readBytes
@@ -65,7 +65,7 @@ class AsyncStreamGraphTests
65
65
val spiedStream = spy(inputStream)
66
66
val asyncStream = AsyncStreamHelper .toAsyncInputStream(spiedStream)
67
67
68
- val readStream = AsyncStreamSource (asyncStream, 42 ).runWith(StreamConverters .asInputStream())
68
+ val readStream = MongoDBAsyncStreamSource (asyncStream, 42 ).runWith(StreamConverters .asInputStream())
69
69
val readBytes = IOUtils .toByteArray(readStream)
70
70
71
71
bytes shouldBe readBytes
@@ -79,7 +79,7 @@ class AsyncStreamGraphTests
79
79
doThrow(exception).when(inputStream).read(any())
80
80
val asyncStream = AsyncStreamHelper .toAsyncInputStream(inputStream)
81
81
82
- val (ioResult, p) = AsyncStreamSource (asyncStream).toMat(Sink .asPublisher(false ))(Keep .both).run()
82
+ val (ioResult, p) = MongoDBAsyncStreamSource (asyncStream).toMat(Sink .asPublisher(false ))(Keep .both).run()
83
83
val c = TestSubscriber .manualProbe[ByteString ]()
84
84
p.subscribe(c)
85
85
@@ -92,7 +92,7 @@ class AsyncStreamGraphTests
92
92
ioResult.futureValue.status.isFailure shouldBe true
93
93
}
94
94
95
- behavior of " AsyncStreamSink "
95
+ behavior of " MongoDBAsyncStreamSink "
96
96
97
97
it should " write all bytes" in {
98
98
val bytes = randomBytes(4000 )
@@ -101,7 +101,7 @@ class AsyncStreamGraphTests
101
101
val os = new ByteArrayOutputStream ()
102
102
val asyncStream = AsyncStreamHelper .toAsyncOutputStream(os)
103
103
104
- val sink = AsyncStreamSink (asyncStream)
104
+ val sink = MongoDBAsyncStreamSink (asyncStream)
105
105
val ioResult = source.toMat(sink)(Keep .right).run()
106
106
107
107
ioResult.futureValue.count shouldBe bytes.length
@@ -117,7 +117,7 @@ class AsyncStreamGraphTests
117
117
val outputStream = new CloseRecordingStream ()
118
118
val asyncStream = AsyncStreamHelper .toAsyncOutputStream(outputStream)
119
119
120
- val sink = AsyncStreamSink (asyncStream)
120
+ val sink = MongoDBAsyncStreamSink (asyncStream)
121
121
val ioResult = source.toMat(sink)(Keep .right).run()
122
122
123
123
ioResult.futureValue.count shouldBe 4000
@@ -129,7 +129,7 @@ class AsyncStreamGraphTests
129
129
val os = new ByteArrayOutputStream ()
130
130
val asyncStream = AsyncStreamHelper .toAsyncOutputStream(os)
131
131
132
- val sink = AsyncStreamSink (asyncStream)
132
+ val sink = MongoDBAsyncStreamSink (asyncStream)
133
133
val ioResult = Source (1 to 10 )
134
134
.map { n ⇒
135
135
if (n == 7 ) throw new Error (" bees!" )
0 commit comments