Skip to content

Commit

Permalink
(yegor256#1597) Bump cactoos-matchers to 0.25
Browse files Browse the repository at this point in the history
  • Loading branch information
victornoel committed May 3, 2021
1 parent 5210945 commit 3b73725
Show file tree
Hide file tree
Showing 19 changed files with 55 additions and 56 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ The MIT License (MIT)
<dependency>
<groupId>org.llorllale</groupId>
<artifactId>cactoos-matchers</artifactId>
<version>0.24</version>
<version>0.25</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/cactoos/bytes/HexOfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
import org.hamcrest.core.IsEqual;
import org.junit.jupiter.api.Test;
import org.llorllale.cactoos.matchers.Assertion;
import org.llorllale.cactoos.matchers.Satisfies;
import org.llorllale.cactoos.matchers.Throws;
import org.llorllale.cactoos.matchers.Verifies;

/**
* Test case for {@link HexOf}.
Expand All @@ -47,7 +47,7 @@ public void emptyText() throws Exception {
new Assertion<>(
"Must represent an empty hexadecimal text",
new HexOf(new TextOf("")).asBytes(),
new Verifies<>(array -> array.length == 0)
new Satisfies<>(array -> array.length == 0)
).affirm();
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/cactoos/collection/BehavesAsCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.hamcrest.core.IsNot;
import org.llorllale.cactoos.matchers.Assertion;
import org.llorllale.cactoos.matchers.HasValues;
import org.llorllale.cactoos.matchers.Verifies;
import org.llorllale.cactoos.matchers.Satisfies;

/**
* Matcher for collection.
Expand Down Expand Up @@ -78,7 +78,7 @@ public boolean matchesSafely(final Collection<E> col) {
"Size must be more than 0",
col,
new IsCollectionWithSize<>(
new Verifies<>(s -> s > 0)
new Satisfies<>(s -> s > 0)
)
).affirm();
new Assertion<>(
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/cactoos/experimental/ThreadsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.cactoos.scalar.LengthOf;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Test;
import org.llorllale.cactoos.matchers.Assertion;
import org.llorllale.cactoos.matchers.HasValues;
import org.llorllale.cactoos.matchers.Throws;
import org.llorllale.cactoos.shaded.org.cactoos.scalar.LengthOf;

/**
* Test case for {@link Threads}.
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/org/cactoos/func/AsyncTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import org.junit.jupiter.api.Test;
import org.llorllale.cactoos.matchers.Assertion;
import org.llorllale.cactoos.matchers.IsApplicable;
import org.llorllale.cactoos.matchers.Verifies;
import org.llorllale.cactoos.matchers.Satisfies;

/**
* Test case for {@link Async}.
Expand All @@ -52,7 +52,7 @@ void runsInBackground() {
),
new IsApplicable<>(
true,
new Verifies<>(
new Satisfies<>(
future -> !future.isDone()
)
)
Expand Down Expand Up @@ -87,7 +87,7 @@ void runsInBackgroundWithoutFuture() {
),
new IsApplicable<>(
true,
new Verifies<>(
new Satisfies<>(
future -> latch.await(1L, TimeUnit.SECONDS)
)
)
Expand Down Expand Up @@ -117,7 +117,7 @@ void runsInBackgroundWithThreadFactory() {
),
new IsApplicable<>(
name,
new Verifies<>(
new Satisfies<>(
future -> {
future.get();
return latch.getCount() == 0;
Expand Down Expand Up @@ -150,7 +150,7 @@ void runsInBackgroundWithExecutorService() {
),
new IsApplicable<>(
name,
new Verifies<>(
new Satisfies<>(
future -> {
future.get();
return latch.getCount() == 0;
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/org/cactoos/func/BiFuncOfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.hamcrest.core.IsSame;
import org.junit.jupiter.api.Test;
import org.llorllale.cactoos.matchers.Assertion;
import org.llorllale.cactoos.matchers.Verifies;
import org.llorllale.cactoos.matchers.Satisfies;

/**
* Test case for {@link BiFuncOf}.
Expand All @@ -48,7 +48,7 @@ void convertsFuncIntoBiFunc() throws Exception {
new BiFuncOf<>(
new FuncOf<>(input -> input)
),
new Verifies<>(
new Satisfies<>(
func -> {
final Object first = new Object();
final Object res = func.apply(first, "discarded");
Expand All @@ -72,7 +72,7 @@ void convertsProcIntoBiFunc() throws Exception {
),
result
),
new Verifies<>(
new Satisfies<>(
func -> {
final Object first = new Object();
final Object res = func.apply(first, "discarded");
Expand All @@ -97,7 +97,7 @@ void convertsLambdaIntoBiFunc() throws Exception {
new Assertion<>(
"Must convert lambda into bi-function",
new BiFuncOf<>((first, second) -> new Object[] {first, second}),
new Verifies<BiFunc<Object, Object, Object[]>>(
new Satisfies<BiFunc<Object, Object, Object[]>>(
func -> {
final Object first = new Object();
final Object second = new Object();
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/org/cactoos/func/FuncOfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.cactoos.scalar.Constant;
import org.junit.jupiter.api.Test;
import org.llorllale.cactoos.matchers.Assertion;
import org.llorllale.cactoos.matchers.Verifies;
import org.llorllale.cactoos.matchers.Satisfies;

/**
* Test case for {@link FuncOf}.
Expand All @@ -50,7 +50,7 @@ void convertsProcIntoFunc() throws Exception {
),
result
),
new Verifies<>(
new Satisfies<>(
func -> {
final Object input = new Object();
final Object res = func.apply(input);
Expand All @@ -66,7 +66,7 @@ void convertsScalarIntoFunc() throws Exception {
new Assertion<>(
"Must convert Scalar into Func",
new FuncOf<>(new Constant<>(result)),
new Verifies<>(
new Satisfies<>(
func -> {
final Object res = func.apply("discarded");
return res.equals(result);
Expand All @@ -80,7 +80,7 @@ void convertsLambdaIntoFunc() throws Exception {
new Assertion<>(
"Must convert Lambda into Func",
new FuncOf<>(input -> input),
new Verifies<>(
new Satisfies<>(
func -> {
final Object input = new Object();
final Object res = func.apply(input);
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/cactoos/io/CloseShieldInputStreamTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.junit.jupiter.api.Test;
import org.llorllale.cactoos.matchers.Assertion;
import org.llorllale.cactoos.matchers.IsText;
import org.llorllale.cactoos.matchers.Verifies;
import org.llorllale.cactoos.matchers.Satisfies;

/**
* Test case for {@link CloseShieldInputStream}.
Expand Down Expand Up @@ -73,7 +73,7 @@ void makesDataAvailable() throws IOException {
new Assertion<>(
"Must show that data is available",
new CloseShieldInputStream(in).available(),
new Verifies<>(l -> l > 0)
new Satisfies<>(l -> l > 0)
).affirm();
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/cactoos/io/InputOfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
import org.llorllale.cactoos.matchers.HasString;
import org.llorllale.cactoos.matchers.IsTrue;
import org.llorllale.cactoos.matchers.MatchesRegex;
import org.llorllale.cactoos.matchers.Satisfies;
import org.llorllale.cactoos.matchers.StartsWith;
import org.llorllale.cactoos.matchers.Verifies;
import org.takes.http.FtRemote;
import org.takes.tk.TkHtml;

Expand Down Expand Up @@ -127,7 +127,7 @@ void readsFileContent() throws Exception {
)
)
).asBytes(),
new Verifies<>(arr -> arr.length > 0)
new Satisfies<>(arr -> arr.length > 0)
).affirm();
}

Expand Down Expand Up @@ -312,7 +312,7 @@ void makesDataAvailable() throws Exception {
new Assertion<>(
"must show that data is available",
new InputOf(content).stream(),
new Verifies<>(s -> s.available() > 0)
new Satisfies<>(s -> s.available() > 0)
).affirm();
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/cactoos/io/InputStreamOfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.junit.rules.TemporaryFolder;
import org.llorllale.cactoos.matchers.Assertion;
import org.llorllale.cactoos.matchers.HasContent;
import org.llorllale.cactoos.matchers.Verifies;
import org.llorllale.cactoos.matchers.Satisfies;

/**
* Test case for {@link InputStreamOf}.
Expand Down Expand Up @@ -94,7 +94,7 @@ public void makesDataAvailable() throws IOException {
new Assertion<>(
"Must show that data is available",
new InputStreamOf(content).available(),
new Verifies<>(x -> x > 0)
new Satisfies<>(x -> x > 0)
).affirm();
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/cactoos/io/StickyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.junit.jupiter.api.Test;
import org.llorllale.cactoos.matchers.Assertion;
import org.llorllale.cactoos.matchers.EndsWith;
import org.llorllale.cactoos.matchers.Verifies;
import org.llorllale.cactoos.matchers.Satisfies;

/**
* Test case for {@link Sticky}.
Expand All @@ -51,7 +51,7 @@ void readsFileContent() {
"org/cactoos/large-text.txt"
)
),
new Verifies<>(
new Satisfies<>(
new Repeated<>(
input -> new BytesOf(
new TeeInput(input, new DeadOutput())
Expand Down
9 changes: 4 additions & 5 deletions src/test/java/org/cactoos/io/TempFileTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
import org.junit.jupiter.api.Test;
import org.llorllale.cactoos.matchers.Assertion;
import org.llorllale.cactoos.matchers.EndsWith;
import org.llorllale.cactoos.matchers.Satisfies;
import org.llorllale.cactoos.matchers.StartsWith;
import org.llorllale.cactoos.matchers.Verifies;

/**
* Unit tests for {@link TempFile}.
Expand All @@ -56,18 +56,17 @@ void createFile() throws Exception {
}

@Test
@SuppressWarnings("unchecked")
void createFileInCustomPath() throws Exception {
final Path custom = Paths.get(System.getProperty("user.home"));
try (TempFile file = new TempFile(() -> custom, "", "")) {
new Assertion<>(
"Must create a temp file at a custom path",
file,
new AllOf<>(
new Verifies<TempFile>(
new AllOf<TempFile>(
new Satisfies<>(
tmp -> Files.exists(tmp.value())
),
new Verifies<TempFile>(
new Satisfies<>(
tmp -> tmp.value().getParent().equals(custom)
)
)
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/cactoos/iterator/IteratorOfBytesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void canBeConstructedFromString() throws Exception {
);
new Assertion<>(
"Must have 1 element",
new ListOf<>(
new ListOf<Object>(
itr.next(),
itr.hasNext()
),
Expand All @@ -66,7 +66,7 @@ public void canBeConstructedFromText() throws Exception {
);
new Assertion<>(
"Must have 3 elements",
new ListOf<>(
new ListOf<Object>(
itr.next(),
itr.next(),
itr.next(),
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/cactoos/iterator/NoNullsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

import org.junit.jupiter.api.Test;
import org.llorllale.cactoos.matchers.Assertion;
import org.llorllale.cactoos.matchers.Satisfies;
import org.llorllale.cactoos.matchers.Throws;
import org.llorllale.cactoos.matchers.Verifies;

/**
* Test cases for {@link NoNulls}.
Expand All @@ -45,7 +45,7 @@ void nextThrowsErrorIfNull() {
new IteratorOf<>(new String[]{null})
).next(),
new Throws<>(
new Verifies<>(
new Satisfies<>(
(String msg) -> msg.matches("^Item #0 of .*? is NULL")
),
IllegalStateException.class
Expand All @@ -64,7 +64,7 @@ void nthThrowsErrorIfNull() {
)
).next(),
new Throws<>(
new Verifies<>(
new Satisfies<>(
(String msg) -> msg.matches("^Item #2 of .*? is NULL")
),
IllegalStateException.class
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/cactoos/list/BehavesAsList.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import org.hamcrest.core.IsNull;
import org.llorllale.cactoos.matchers.Assertion;
import org.llorllale.cactoos.matchers.IsTrue;
import org.llorllale.cactoos.matchers.Verifies;
import org.llorllale.cactoos.matchers.Satisfies;

/**
* Matcher for collection.
Expand Down Expand Up @@ -64,12 +64,12 @@ public boolean matchesSafely(final List<E> list) {
new Assertion<>(
"must have an index for the sample item",
list.indexOf(this.sample),
new Verifies<>(i -> i >= 0)
new Satisfies<>(i -> i >= 0)
).affirm();
new Assertion<>(
"must have a last index for the sample item",
list.lastIndexOf(this.sample),
new Verifies<>(i -> i >= 0)
new Satisfies<>(i -> i >= 0)
).affirm();
new Assertion<>(
"must have at least one element in list iterator",
Expand Down
Loading

0 comments on commit 3b73725

Please sign in to comment.