Questions tagged [android-assertj]

A set of AssertJ helpers geared toward testing Android.

AssertJ extension made by Square. It aims to make it even easier to test Android. https://square.github.io/assertj-android/

Just compare android-assertj:

assertThat(view).isGone();

with assertj-core:

assertThat(view.getVisibility()).isEqualTo(View.GONE);

with plain junit:

assertEquals(View.GONE, view.getVisibility());
6 questions
8
votes
3 answers

Android AssertJ 1.0.0 with Android gradle 1.1.1

Here is part of my build.gradle that has conflict: ... dependencies { classpath 'com.android.tools.build:gradle:1.1.1' } ... testCompile( 'com.squareup.assertj:assertj-android:1.0.0' ) ... The issue that I see in log: WARNING: Conflict with…
Eugen Martynov
  • 19,888
  • 10
  • 61
  • 114
3
votes
3 answers

how to make assert to wait for IdlingResource to assert

I want to use idling resources because I´m using RxJava and EventBus in my app and sometimes my tests fail (I´m thinking that is because that synchronisation). Dependencies: androidTestCompile 'com.android.support.test:runner:0.4' androidTestCompile…
Daniel Gomez Rico
  • 15,026
  • 20
  • 92
  • 162
1
vote
2 answers

Error:Module 'com.squareup.assertj:assertj-android-recyclerview-v7:1.1.1' depends on one or more Android Libraries but is a jar

Im using assertj to do some assertions not allowed in espresso but I dont understand the problem here, I did what is said in here. build.gradle dependencies { // Android Tests androidTestCompile…
david
  • 2,900
  • 5
  • 28
  • 48
1
vote
1 answer

Android - Assertj Android - Run error

I´m trying to run assertj-android but it send an error. (it runs fine with junit 4) My Dependencies: dependencies { testCompile 'junit:junit:4.12' androidTestCompile ('com.squareup.assertj:assertj-android:1.0.0'){ exclude…
Daniel Gomez Rico
  • 15,026
  • 20
  • 92
  • 162
0
votes
1 answer

How to compare two intent using assertj-android

Hi I am using roboelectric for unit testing of my android application. I want to compare expected intent and actual intent using assertj-android. I have added required dependency of assertj-android, even though I have done Gradle sync multiple times…
N Sharma
  • 33,489
  • 95
  • 256
  • 444
0
votes
1 answer

java.lang.NoSuchMethodError: org.assertj.core.api.Assertions.assertThat(Ljava/util/Map;)Lorg/assertj/core/api/MapAssert;

When running unitTest on AndroidStudio (1.4), my below test fail as per title i.e. java.lang.NoSuchMethodError: org.assertj.core.api.Assertions.assertThat(Ljava/util/Map;)Lorg/assertj/core/api/MapAssert; @Test public void mapTest() { Map
Elye
  • 53,639
  • 54
  • 212
  • 474