AssertJ RxJava


Source link: https://github.com/ribot/assertj-rx

Deprecated

Assertj-rx is now deprecated. In-order to test observabales, please use the TestSubscriber - more information on this can be found here. Whilst the current version still remains usable, there will no longer be any new development taking place.

AssertJ RxJava

AssertJ assertions for RxJava Observables.

This library extends AssertJ core with the aim of providing elegant assertions to test RxJava Observables. The current version of this library only provides assertions aimed at testing "cold" Observables. You will need to transform your Observable into a BlockingObservable before performing any assertion.

Feedback and contributions are very welcome.

##Examples

  • Assert that completes successfully without emitting any error:
assertThat(observable.toBlocking()).completes();
  • Assert that completes after emitting a single value "hello":
assertThat(observable.toBlocking())
  .completes()
  .emitsSingleValue("hello");
  • Assert that completes without emitting any value:
assertThat(observable.toBlocking())
  .completes()
  .emitsNoValues();
  • Assert that emits an error:
assertThat(observable.toBlocking()).fails();
  • Assert that emits an error of type IllegalArgumentException
assertThat(observable.toBlocking())
  .failsWithError(IllegalArgumentException.class);
  • Assert that completes after emitting three values that are exactly "a", "b" and "c":
assertThat(observable.toBlocking())
  .completes()
  .listOfValuesEmitted()
  .containsExactly("a", "b", "c");
  • Assert that fails after emitting "a" and "b":
assertThat(observable.toBlocking())
  .fails()
  .listOfValuesEmitted()
  .containsExactly("a", "b");
  • Assert that completes after emitting 10 values
assertThat(observable.toBlocking())
 .completes()
 .valuesCountIs(10);

Installation

Artifacts are on Maven central.

Gradle:

testCompile 'uk.co.ribot.assertj-rx:assertj-rx:0.1.0'

Maven:

<dependency>
<groupId>uk.co.ribot.assertj-rx</groupId>
<artifactId>assertj-rx</artifactId>
<version>0.1.0</version>
<scope>test</scope> </dependency>

Alternatively, you can download the jar from the releases section.

License

Copyright (C) 2015 Ribot Ltd.  Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License. You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 

Resources

Android library scanning BLE (Bluetooth Low Energy) beacons nearby with RxJava.

Like FragmentManager but for Views.

Slide down menu for Android from (old) Circle app.

This library allows the usage of RxJava with the new Android M permission model.

ChipView enables you to easily create Chip list with optional click listener on each Chip.

ChipView is highly customizable to the point you can control every Chip layout and background colors (normal and selected) individually.

MAPS.ME is an open source cross-platform offline maps application, built on top of crowd-sourced OpenStreetMap data.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes