src/test/java/tech/zettervall/openlibrary/rxclient/OpenLibraryClientTest.java
/**
     * Test a failed API fetch of SearchResult.
     */
Test a failed API fetch of SearchResult.
Test a failed API fetch of SearchResult .
@Test
    public void searchFail() {
        openLibraryClient.getRepository().search(Repository.SearchType.Q, "", null)
                .blockingSubscribe(new DisposableSingleObserver<SearchResult>() {
                    @Override
                    public void onSuccess(@NonNull SearchResult searchResult) {
                        fail();
                    }
                    @Override
                    public void onError(@NonNull Throwable e) {
                        assertTrue(e.toString().contains("404"));
                    }
                });
    }
@ Test public void searchFail ( ) { openLibraryClient . getRepository ( ) . search ( Repository . SearchType . Q , "" , null ) . blockingSubscribe ( new DisposableSingleObserver < SearchResult > ( ) { @ Override public void onSuccess ( @ NonNull SearchResult searchResult ) { fail ( ) ; } @ Override public void onError ( @ NonNull Throwable e ) { assertTrue ( e . toString ( ) . contains ( "404" ) ) ; } } ) ; }
Test a failed API fetch of SearchResult.
Test a failed API fetch of SearchResult .