Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

#121: Use assertJ everywhere #128

Merged

Conversation

vpondala
Copy link
Contributor

@vpondala vpondala commented Oct 7, 2017

Migrated all assertions to AssertJ.

Migrated all assertions to AssertJ.
@vpondala
Copy link
Contributor Author

vpondala commented Oct 7, 2017

My local build succeeded. This is my 1st Android build, not sure how to fix it, Can you please guide?

@StefMa
Copy link
Contributor

StefMa commented Oct 7, 2017 via email

Exclude META-INF/LICENSE from packaging to avoid "Duplicate files copied in APK META-INF/LICENSE" error
@vpondala vpondala force-pushed the feature/migrate_to_assertj_assertions branch from ad1ab42 to 94f778c Compare October 7, 2017 11:06
@vpondala
Copy link
Contributor Author

vpondala commented Oct 7, 2017

I added packagingOptions { exclude 'META-INF/LICENSE' } and the build passes now. Please have a look at the diffs and let me know if the changes look good.

"test ui thread".equals(currentThread.getName()));
assertThat(testThread).isNotSameAs(currentThread);
assertThat("test ui thread")
.as("executed on wrong thread")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't know this one, great 🎉

assertEquals(beforeLast[1], false);
assertNotNull(beforeLast[2]);
assertThat(beforeLast[0]).isEqualTo(TiPresenter.State.VIEW_DETACHED);
assertThat(beforeLast[1]).isEqualTo(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better use .isFalse()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In these cases, it's AbstractObjectAssert, which does not have isTrue()/isFalse().

@passsy
Copy link
Contributor

passsy commented Oct 7, 2017

There's a mixup between import static org.assertj.core.api.Assertions.*; and import static org.assertj.core.api.Java6Assertions.*;. The Java6Assertions was required for androidTests in the past. I'm not sure if this is still the case, AssertJ improved Android support a lot recently.

Try to use import static org.assertj.core.api.Assertions.*; everywhere

Used org.assertj.core.api.Assertions everywhere
@passsy passsy merged commit fb40eda into GCX-HCI:master Oct 8, 2017
@passsy
Copy link
Contributor

passsy commented Oct 8, 2017

Thanks for your contribution!

@StefMa StefMa mentioned this pull request Oct 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants