19
19
import java .util .concurrent .Flow ;
20
20
import java .util .concurrent .SubmissionPublisher ;
21
21
22
- public class ReactiveStreamsFlowBridgeTest {
22
+ public class FlowAdaptersTest {
23
23
@ Test
24
24
public void reactiveToFlowNormal () {
25
25
MulticastPublisher <Integer > p = new MulticastPublisher <Integer >(new Executor () {
@@ -31,7 +31,7 @@ public void execute(Runnable command) {
31
31
32
32
TestEitherConsumer <Integer > tc = new TestEitherConsumer <Integer >();
33
33
34
- ReactiveStreamsFlowBridge .toFlowPublisher (p ).subscribe (tc );
34
+ FlowAdapters .toFlowPublisher (p ).subscribe (tc );
35
35
36
36
p .offer (1 );
37
37
p .offer (2 );
@@ -54,7 +54,7 @@ public void execute(Runnable command) {
54
54
55
55
TestEitherConsumer <Integer > tc = new TestEitherConsumer <Integer >();
56
56
57
- ReactiveStreamsFlowBridge .toFlowPublisher (p ).subscribe (tc );
57
+ FlowAdapters .toFlowPublisher (p ).subscribe (tc );
58
58
59
59
p .offer (1 );
60
60
p .offer (2 );
@@ -77,7 +77,7 @@ public void execute(Runnable command) {
77
77
78
78
TestEitherConsumer <Integer > tc = new TestEitherConsumer <Integer >();
79
79
80
- ReactiveStreamsFlowBridge .toPublisher (p ).subscribe (tc );
80
+ FlowAdapters .toPublisher (p ).subscribe (tc );
81
81
82
82
p .submit (1 );
83
83
p .submit (2 );
@@ -100,7 +100,7 @@ public void execute(Runnable command) {
100
100
101
101
TestEitherConsumer <Integer > tc = new TestEitherConsumer <Integer >();
102
102
103
- ReactiveStreamsFlowBridge .toPublisher (p ).subscribe (tc );
103
+ FlowAdapters .toPublisher (p ).subscribe (tc );
104
104
105
105
p .submit (1 );
106
106
p .submit (2 );
@@ -116,7 +116,7 @@ public void execute(Runnable command) {
116
116
public void reactiveStreamsToFlowSubscriber () {
117
117
TestEitherConsumer <Integer > tc = new TestEitherConsumer <Integer >();
118
118
119
- Flow .Subscriber <Integer > fs = ReactiveStreamsFlowBridge .toFlowSubscriber (tc );
119
+ Flow .Subscriber <Integer > fs = FlowAdapters .toFlowSubscriber (tc );
120
120
121
121
final Object [] state = { null , null };
122
122
@@ -148,7 +148,7 @@ public void cancel() {
148
148
public void flowToReactiveStreamsSubscriber () {
149
149
TestEitherConsumer <Integer > tc = new TestEitherConsumer <Integer >();
150
150
151
- org .reactivestreams .Subscriber <Integer > fs = ReactiveStreamsFlowBridge .toSubscriber (tc );
151
+ org .reactivestreams .Subscriber <Integer > fs = FlowAdapters .toSubscriber (tc );
152
152
153
153
final Object [] state = { null , null };
154
154
@@ -192,8 +192,8 @@ public void stableConversionForSubscriber() {
192
192
@ Override public void onComplete () {};
193
193
};
194
194
195
- Assert .assertSame (ReactiveStreamsFlowBridge .toSubscriber (ReactiveStreamsFlowBridge .toFlowSubscriber (rsSub )), rsSub );
196
- Assert .assertSame (ReactiveStreamsFlowBridge .toFlowSubscriber (ReactiveStreamsFlowBridge .toSubscriber (fSub )), fSub );
195
+ Assert .assertSame (FlowAdapters .toSubscriber (FlowAdapters .toFlowSubscriber (rsSub )), rsSub );
196
+ Assert .assertSame (FlowAdapters .toFlowSubscriber (FlowAdapters .toSubscriber (fSub )), fSub );
197
197
}
198
198
199
199
@ Test
@@ -214,8 +214,8 @@ public void stableConversionForProcessor() {
214
214
@ Override public void subscribe (Flow .Subscriber s ) {};
215
215
};
216
216
217
- Assert .assertSame (ReactiveStreamsFlowBridge .toProcessor (ReactiveStreamsFlowBridge .toFlowProcessor (rsPro )), rsPro );
218
- Assert .assertSame (ReactiveStreamsFlowBridge .toFlowProcessor (ReactiveStreamsFlowBridge .toProcessor (fPro )), fPro );
217
+ Assert .assertSame (FlowAdapters .toProcessor (FlowAdapters .toFlowProcessor (rsPro )), rsPro );
218
+ Assert .assertSame (FlowAdapters .toFlowProcessor (FlowAdapters .toProcessor (fPro )), fPro );
219
219
}
220
220
221
221
@ Test
@@ -228,7 +228,7 @@ public void stableConversionForPublisher() {
228
228
@ Override public void subscribe (Flow .Subscriber s ) {};
229
229
};
230
230
231
- Assert .assertSame (ReactiveStreamsFlowBridge .toPublisher (ReactiveStreamsFlowBridge .toFlowPublisher (rsPub )), rsPub );
232
- Assert .assertSame (ReactiveStreamsFlowBridge .toFlowPublisher (ReactiveStreamsFlowBridge .toPublisher (fPub )), fPub );
231
+ Assert .assertSame (FlowAdapters .toPublisher (FlowAdapters .toFlowPublisher (rsPub )), rsPub );
232
+ Assert .assertSame (FlowAdapters .toFlowPublisher (FlowAdapters .toPublisher (fPub )), fPub );
233
233
}
234
234
}
0 commit comments