Created
January 19, 2018 16:17
-
-
Save TikhomirovSergey/84bc9e8619aec2d53992919d01f7b703 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Step("Условие {0}") | |
protected <T extends Object> void assertThat(Description description, T toBeMatched, Matcher matcher) { | |
org.junit.Assert.assertThat(toBeMatched, matcher); | |
} | |
@Step("{0}:") | |
public final <T extends Object> AssertSteps assertThat(String message, T toBeMatched, Matcher... matchers) { | |
checkArgument(matchers.length >= 0, "Число проверок должно быть больше 0:"); | |
for (Matcher<?> matcher: matchers) { | |
this.assertThat(new StringDescription().appendText(message).appendText("\n").appendDescriptionOf(matcher), | |
toBeMatched, matcher); | |
} | |
return this; | |
} | |
@Step("{0}") | |
public AssertSteps perform(@NotNull String description, @NotNull Consumer<AssertSteps> stepsConsumer) { | |
return PerformStep.super.perform(description, stepsConsumer); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment