Skip to content

Commit

Permalink
Use hamcrest public apis rather than internal, for forward compatibil…
Browse files Browse the repository at this point in the history
…ity. (#436)
  • Loading branch information
jozuasijsling authored Aug 30, 2021
1 parent e688249 commit e8a592a
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import com.adevinta.android.barista.internal.matcher.ListViewNotEmptyAssertion
import com.adevinta.android.barista.internal.matcher.RecyclerViewItemCountAssertion
import com.adevinta.android.barista.internal.matcher.RecyclerViewNotEmptyAssertion
import com.adevinta.android.barista.internal.matcher.withCompatText
import org.hamcrest.CoreMatchers
import org.hamcrest.Description
import org.hamcrest.Matcher
import org.hamcrest.Matchers
import org.hamcrest.TypeSafeMatcher

object BaristaListAssertions {
Expand Down Expand Up @@ -82,7 +82,7 @@ object BaristaListAssertions {
position = position,
targetViewId = targetViewId,
viewAssertion = ViewAssertions.matches(
CoreMatchers.anyOf(
Matchers.anyOf(
ViewMatchers.withChild(withCompatText(text)),
withCompatText(text)
)
Expand All @@ -102,7 +102,7 @@ object BaristaListAssertions {
position = position,
targetViewId = targetViewId,
viewAssertion = ViewAssertions.matches(
CoreMatchers.anyOf(
Matchers.anyOf(
ViewMatchers.withChild(ViewMatchers.withText(textId)),
ViewMatchers.withText(textId)
)
Expand All @@ -124,7 +124,7 @@ object BaristaListAssertions {
position = position,
targetViewId = targetViewId,
viewAssertion = ViewAssertions.matches(
CoreMatchers.anyOf(
Matchers.anyOf(
ViewMatchers.hasDescendant(DrawableMatcher.withDrawable(drawableRes)),
DrawableMatcher.withDrawable(drawableRes)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import com.adevinta.android.barista.internal.matcher.TextColorMatcher
import com.adevinta.android.barista.internal.matcher.TextStyleableColorMatcher
import com.adevinta.android.barista.internal.util.resourceMatcher
import com.adevinta.android.barista.internal.matcher.withCompatText
import org.hamcrest.CoreMatchers.containsString
import org.hamcrest.Matcher
import org.hamcrest.Matchers.allOf
import org.hamcrest.Matchers.containsString
import org.hamcrest.Matchers.not

object BaristaVisibilityAssertions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import androidx.test.espresso.matcher.ViewMatchers.hasFocus
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.espresso.matcher.ViewMatchers.withId
import com.adevinta.android.barista.internal.performAction
import org.hamcrest.core.AllOf.allOf
import org.hamcrest.Matchers.allOf

object BaristaKeyboardInteractions {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import com.adevinta.android.barista.internal.failurehandler.description
import com.adevinta.android.barista.internal.failurehandler.withFailureHandler
import com.adevinta.android.barista.internal.viewaction.ClickChildAction.clickChildWithId
import com.adevinta.android.barista.internal.viewaction.PerformClickAction.clickUsingPerformClick
import org.hamcrest.CoreMatchers.allOf
import org.hamcrest.CoreMatchers.anyOf
import org.hamcrest.CoreMatchers.anything
import org.hamcrest.Matcher
import org.hamcrest.Matchers.allOf
import org.hamcrest.Matchers.anyOf
import org.hamcrest.Matchers.anything

object BaristaListInteractions {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import static androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static org.hamcrest.core.AllOf.allOf;
import static org.hamcrest.Matchers.allOf;

public class DisplayedMatchers {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import com.adevinta.android.barista.internal.viewaction.SwipeActions.swipeLeft
import com.adevinta.android.barista.internal.viewaction.SwipeActions.swipeRight
import com.adevinta.android.barista.internal.viewaction.ViewPager2SwipeAction.Direction.BACKWARD
import com.adevinta.android.barista.internal.viewaction.ViewPager2SwipeAction.Direction.FORWARD
import org.hamcrest.CoreMatchers.allOf
import org.hamcrest.CoreMatchers.anyOf
import org.hamcrest.Matcher
import org.hamcrest.Matchers.allOf
import org.hamcrest.Matchers.anyOf

object SwipeActions {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import org.junit.Rule;
import org.junit.Test;

import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNull.notNullValue;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.junit.Assert.assertThat;

public class BaristaRuleActivityTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import com.adevinta.android.barista.assertion.BaristaListAssertions.assertListIt
import com.adevinta.android.barista.assertion.BaristaListAssertions.assertListNotEmpty
import com.adevinta.android.barista.internal.failurehandler.BaristaException
import junit.framework.AssertionFailedError
import org.hamcrest.CoreMatchers
import org.hamcrest.Matchers
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
Expand Down Expand Up @@ -124,7 +124,7 @@ class ListViewAssertionTest {
position = 4,
targetViewId = android.R.id.text1,
viewAssertion = ViewAssertions.matches(
CoreMatchers.anyOf(
Matchers.anyOf(
ViewMatchers.withChild(ViewMatchers.withText("Bilberry")),
ViewMatchers.withText("Bilberry")
)
Expand All @@ -140,7 +140,7 @@ class ListViewAssertionTest {
position = 19,
targetViewId = R.id.textview,
viewAssertion = ViewAssertions.matches(
CoreMatchers.anyOf(
Matchers.anyOf(
ViewMatchers.withChild(ViewMatchers.withText("Dragonfruit")),
ViewMatchers.withText("Dragonfruit")
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import static com.adevinta.android.barista.assertion.BaristaVisibilityAssertions.assertNotExist;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.ThrowableAssert.catchThrowable;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;

public class VisibilityAssertionsTest {

Expand Down

0 comments on commit e8a592a

Please sign in to comment.