Skip to content

Commit ac75ded

Browse files
Update RxSwing use of Scan
The initial value is sent when first onNext is sent, not at subscription time.
1 parent 11a8d39 commit ac75ded

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

rxjava-contrib/rxjava-swing/src/test/java/rx/swing/sources/KeyEventSourceTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,10 @@ public void call() {
9595
.subscribe(action, error, complete);
9696

9797
InOrder inOrder = inOrder(action);
98+
fireKeyEvent(keyEvent(1, KeyEvent.KEY_PRESSED));
99+
// we receive an empty event at the beginning due to behavior of scan with an initial value
98100
inOrder.verify(action, times(1)).call(
99101
Collections.<Integer> emptySet());
100-
verify(error, never()).call(Matchers.<Throwable> any());
101-
verify(complete, never()).call();
102-
103-
fireKeyEvent(keyEvent(1, KeyEvent.KEY_PRESSED));
104102
inOrder.verify(action, times(1)).call(
105103
new HashSet<Integer>(asList(1)));
106104
verify(error, never()).call(Matchers.<Throwable> any());

0 commit comments

Comments
 (0)