Skip to content
Permalink
Browse files

doc adjustments to Matchers class java doc

  • Loading branch information...
MykolaGolubyev committed Nov 7, 2019
1 parent 72cd442 commit eb84fd61b963e88378e28fd21425882463bb23c1
@@ -30,7 +30,7 @@ public static ActualValueExpectations actual(Object actual) {
* <pre>
* code(() -> {
* businessLogic(-10);
* }).should(throwException(IllegalArgumentException.class, "negative are not allowed"));
* }).should(throwException(IllegalArgumentException.class, "negatives are not allowed"));
* </pre>
*
* @param codeBlock code to match against
@@ -142,7 +142,7 @@ public static LessThanOrEqualMatcher lessThanOrEqual(Object expected) {
* <pre>
* code(() -> {
* businessLogic(-10);
* }).should(throwException("negative are not allowed"));
* }).should(throwException("negatives are not allowed"));
* </pre>
* @see #code(CodeBlock)
*
@@ -207,7 +207,7 @@ public static ThrowExceptionMatcher throwException(Class expectedClass, Pattern
* <pre>
* code(() -> {
* businessLogic(-10);
* }).should(throwException(IllegalArgumentException.class, "negative are not allowed"));
* }).should(throwException(IllegalArgumentException.class, "negatives are not allowed"));
* </pre>
* @see #code(CodeBlock)
*
@@ -220,7 +220,8 @@ public static ThrowExceptionMatcher throwException(Class expectedClass, String e
}

/**
* Deprecated. Instead use
* @deprecated due to introduction of <code>should[Not]Be</code>, <code>waitTo[Not]</code> variants,
* use {@link #greaterThan(Object)} instead
* <pre>
* actual(value).shouldBe(greaterThan(10));
* </pre>
@@ -232,7 +233,8 @@ public static GreaterThanMatcher beGreaterThan(Object expected) {
}

/**
* Deprecated. Instead use
* @deprecated due to introduction of <code>should[Not]Be</code>, <code>waitTo[Not]</code> variants,
* use {@link #greaterThanOrEqual(Object)} instead
* <pre>
* actual(value).shouldBe(greaterThanOrEqual(10));
* </pre>
@@ -244,7 +246,8 @@ public static GreaterThanOrEqualMatcher beGreaterThanOrEqual(Object expected) {
}

/**
* Deprecated. Instead use
* @deprecated due to introduction of <code>should[Not]Be</code>, <code>waitTo[Not]</code> variants,
* use {@link #lessThan(Object)} instead
* <pre>
* actual(value).shouldBe(lessThan(10));
* </pre>
@@ -256,7 +259,8 @@ public static LessThanMatcher beLessThan(Object expected) {
}

/**
* Deprecated. Instead use
* @deprecated due to introduction of <code>should[Not]Be</code>, <code>waitTo[Not]</code> variants,
* use {@link #lessThanOrEqual(Object)} instead
* <pre>
* actual(value).shouldBe(lessThanOrEqual(10));
* </pre>
@@ -28,15 +28,15 @@
public void examples() {
code(() -> {
businessLogic(-10);
}).should(throwException("negative are not allowed"));
}).should(throwException("negatives are not allowed"));

code(() -> {
businessLogic(-10);
}).should(throwException(IllegalArgumentException.class, "negative are not allowed"));
}).should(throwException(IllegalArgumentException.class, "negatives are not allowed"));

code(() -> {
businessLogic(-10);
}).should(throwException(IllegalArgumentException.class, Pattern.compile("negative .* not allowed")));
}).should(throwException(IllegalArgumentException.class, Pattern.compile("negatives .* not allowed")));

code(() -> {
businessLogic(-10);
@@ -45,7 +45,7 @@ public void examples() {

private static void businessLogic(int num) {
if (num < 0) {
throw new IllegalArgumentException("negative are not allowed");
throw new IllegalArgumentException("negatives are not allowed");
}
}
}

0 comments on commit eb84fd6

Please sign in to comment.
You can’t perform that action at this time.