Skip to content

Commit

Permalink
(yegor256#829) Fix PR issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pbenety committed May 22, 2018
1 parent d9a517b commit 3a1327f
Showing 1 changed file with 75 additions and 5 deletions.
80 changes: 75 additions & 5 deletions src/test/java/org/cactoos/scalar/AndInThreadsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,24 @@
import java.util.concurrent.Executors;
import org.cactoos.Proc;
import org.cactoos.Scalar;
import org.cactoos.collection.CollectionOf;
import org.cactoos.func.FuncOf;
import org.cactoos.iterable.IterableOf;
import org.cactoos.iterable.Mapped;
import org.cactoos.list.ListOf;
import org.hamcrest.Matcher;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.hamcrest.collection.IsIterableContainingInAnyOrder;
import org.junit.Test;
import org.llorllale.cactoos.matchers.MatcherOf;
import org.llorllale.cactoos.matchers.ScalarHasValue;

/**
* Test case for {@link AndInThreads}.
* @since 0.25
* @todo #829:30min Remove the use of the static method
* `Collections.synchronizedList`. Replace by an object-oriented approach.
* @checkstyle JavadocMethodCheck (500 lines)
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
Expand Down Expand Up @@ -112,7 +117,20 @@ public void iteratesList() {
);
MatcherAssert.assertThat(
list,
Matchers.containsInAnyOrder("hello", "world")
new IsIterableContainingInAnyOrder<String>(
new CollectionOf<Matcher<? super String>>(
new MatcherOf<>(
text -> {
return "hello".equals(text);
}
),
new MatcherOf<>(
text -> {
return "world".equals(text);
}
)
)
)
);
}

Expand Down Expand Up @@ -152,7 +170,20 @@ public void worksWithProc() throws Exception {
).value();
MatcherAssert.assertThat(
list,
Matchers.contains(1, 1)
new IsIterableContainingInAnyOrder<Integer>(
new CollectionOf<Matcher<? super Integer>>(
new MatcherOf<>(
value -> {
return value.equals(1);
}
),
new MatcherOf<>(
value -> {
return value.equals(1);
}
)
)
)
);
}

Expand All @@ -178,7 +209,20 @@ public void worksWithProcIterable() throws Exception {
).value();
MatcherAssert.assertThat(
list,
Matchers.containsInAnyOrder(1, 2)
new IsIterableContainingInAnyOrder<Integer>(
new CollectionOf<Matcher<? super Integer>>(
new MatcherOf<>(
value -> {
return value.equals(1);
}
),
new MatcherOf<>(
value -> {
return value.equals(2);
}
)
)
)
);
}

Expand Down Expand Up @@ -208,7 +252,20 @@ public void worksWithExecServiceProcValues() throws Exception {
).value();
MatcherAssert.assertThat(
list,
Matchers.containsInAnyOrder(1, 2)
new IsIterableContainingInAnyOrder<Integer>(
new CollectionOf<Matcher<? super Integer>>(
new MatcherOf<>(
value -> {
return value.equals(1);
}
),
new MatcherOf<>(
value -> {
return value.equals(2);
}
)
)
)
);
}

Expand All @@ -225,7 +282,20 @@ public void worksWithExecServiceProcIterable() throws Exception {
).value();
MatcherAssert.assertThat(
list,
Matchers.containsInAnyOrder(1, 2)
new IsIterableContainingInAnyOrder<Integer>(
new CollectionOf<Matcher<? super Integer>>(
new MatcherOf<>(
value -> {
return value.equals(1);
}
),
new MatcherOf<>(
value -> {
return value.equals(2);
}
)
)
)
);
}

Expand Down

0 comments on commit 3a1327f

Please sign in to comment.