any errors throwed by GSON and report an * UnexpectedResponse to the foward steps * */ public class DeserializationIssuesHandler<T> implements FlowableTransformer<T, T> {
void beforeEachTest() { server = new MockWebServer(); NumbersWebService numberAPI = new Retrofit.Builder() .baseUrl(server.url("/").toString()) .create(NumbersWebService.class); infrastructure = new TriviaInfrastructure( numberAPI, new TriviaGenerator(), new PayloadMapper(), new PayloadValidator(), Schedulers.trampoline() // non-concurrent integration on tests ); }
void beforeEachTest() { server = new MockWebServer(); NumbersWebService numberAPI = new Retrofit.Builder() .baseUrl(server.url("/").toString()) .create(NumbersWebService.class); infrastructure = new TriviaInfrastructure( numberAPI, new TriviaGenerator(), new PayloadMapper(), new PayloadValidator(), Schedulers.trampoline() // non-concurrent integration on tests ); }
method public BehavioursVerifier shouldShowErrorState() throws Exception { checkErrorStateView(); ErrorStateView view = (ErrorStateView) target; verify(view.showErrorState(), oneTimeOnly()).run(); return this; } // For each View and each behavior, check if bind / apply is possible private void checkEmptyStateView() { if (!(target instanceof EmptyStateView)) throw new IllegalArgumentException("Not an EmptyStateView"); }
throws Exception { checkErrorStateView(); ErrorStateView view = (ErrorStateView) target; verify(view.showErrorState(), oneTimeOnly()).run(); return this; } // For each View and each behavior, check if bind / apply is possible private void checkEmptyStateView() { if (!(target instanceof EmptyStateView)) throw new IllegalArgumentException("Not an EmptyStateView"); }
throws Exception { checkErrorStateView(); ErrorStateView view = (ErrorStateView) target; verify(view.showErrorState(), oneTimeOnly()).run(); return this; } // For each View and each behavior, check if bind / apply is possible private void checkEmptyStateView() { if (!(target instanceof EmptyStateView)) throw new IllegalArgumentException(“Not an EmptyStateView"); }
that should have 49 chars at most, no more”; FactAboutNumber fact = FactAboutNumber.of("1", text); FactViewModel model = mapper.translate(fact); assertThat(model).isInstanceOf(NumberAndFact.class); } @Test public void shouldMap_Above50Chars_AsSingleLabelModel() { String text = "Another text that is much,” + "much larger than 50 characters”; FactAboutNumber fact = FactAboutNumber.of("17", text); FactViewModel model = mapper.translate(fact); assertThat(model).isInstanceOf(ComposedWithSpannedStyles.class); }
that should have 49 chars at most, no more”; FactAboutNumber fact = FactAboutNumber.of("1", text); FactViewModel model = mapper.translate(fact); assertThat(model).isInstanceOf(NumberAndFact.class); } @Test public void shouldMap_Above50Chars_AsSingleLabelModel() { String text = "Another text that is much,” + "much larger than 50 characters”; FactAboutNumber fact = FactAboutNumber.of("17", text); FactViewModel model = mapper.translate(fact); assertThat(model).isInstanceOf(ComposedWithSpannedStyles.class); }
that should have 49 chars at most, no more”; FactAboutNumber fact = FactAboutNumber.of("1", text); FactViewModel model = mapper.translate(fact); assertThat(model).isInstanceOf(NumberAndFact.class); } @Test public void shouldMap_Above50Chars_AsSingleLabelModel() { String text = "Another text that is much,” + "much larger than 50 characters”; FactAboutNumber fact = FactAboutNumber.of("17", text); FactViewModel model = mapper.translate(fact); assertThat(model).isInstanceOf(ComposedWithSpannedStyles.class); }
design_layout_snackbar_include.xml, since Snackbar // does not have an id assigned at his own container View snackText = findById(activity, R.id.snackbar_text); assertThat(snackText).isNotNull(); assertThat(snackText.getVisibility()).isEqualTo(View.VISIBLE); }
design_layout_snackbar_include.xml, since Snackbar // does not have an id assigned at his own container View snackText = findById(activity, R.id.snackbar_text); assertThat(snackText).isNotNull(); assertThat(snackText.getVisibility()).isEqualTo(View.VISIBLE); }