Debian Codegraph @

src/test/java/io/reactivex/rxjava3/flowable/FlowableNotificationTest.java

raw
1 /*
2 * Copyright (c) 2016-present, RxJava Contributors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 * compliance with the License. You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software distributed under the License is
10 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 * the License for the specific language governing permissions and limitations under the License.
12 */
13
14 package io.reactivex.rxjava3.flowable;
15
16 import org.junit.*;
17
18 import io.reactivex.rxjava3.core.*;
19
20 public class FlowableNotificationTest extends RxJavaTest {
21
22 @Test(expected = NullPointerException.class)
23 public void onNextIntegerNotificationDoesNotEqualNullNotification() {
24 final Notification<Integer> integerNotification = Notification.createOnNext(1);
25 final Notification<Integer> nullNotification = Notification.createOnNext(null);
26 Assert.assertNotEquals(integerNotification, nullNotification);
27 }
28
29 @Test(expected = NullPointerException.class)
30 public void onNextNullNotificationDoesNotEqualIntegerNotification() {
31 final Notification<Integer> integerNotification = Notification.createOnNext(1);
32 final Notification<Integer> nullNotification = Notification.createOnNext(null);
33 Assert.assertNotEquals(nullNotification, integerNotification);
34 }
35
36 @Test
37 public void onNextIntegerNotificationsWhenEqual() {
38 final Notification<Integer> integerNotification = Notification.createOnNext(1);
39 final Notification<Integer> integerNotification2 = Notification.createOnNext(1);
40 Assert.assertEquals(integerNotification, integerNotification2);
41 }
42
43 @Test
44 public void onNextIntegerNotificationsWhenNotEqual() {
45 final Notification<Integer> integerNotification = Notification.createOnNext(1);
46 final Notification<Integer> integerNotification2 = Notification.createOnNext(2);
47 Assert.assertNotEquals(integerNotification, integerNotification2);
48 }
49
50 @Test
51 public void onErrorIntegerNotificationsWhenEqual() {
52 final Exception exception = new Exception();
53 final Notification<Integer> onErrorNotification = Notification.createOnError(exception);
54 final Notification<Integer> onErrorNotification2 = Notification.createOnError(exception);
55 Assert.assertEquals(onErrorNotification, onErrorNotification2);
56 }
57
58 @Test
59 public void onErrorIntegerNotificationWhenNotEqual() {
60 final Notification<Integer> onErrorNotification = Notification.createOnError(new Exception());
61 final Notification<Integer> onErrorNotification2 = Notification.createOnError(new Exception());
62 Assert.assertNotEquals(onErrorNotification, onErrorNotification2);
63 }
64 }