@Test public void conversionZeroValueToBooleanShouldFailed() { thrown.expect(AssertionError.class); thrown.expectMessage("string converted to java.lang.Boolean <false>"); thrown.expectMessage("failed with java.lang.IllegalArgumentException: \"0\" is not a boolean value"); assertThat("0", asBoolean(equalTo(false))); }
@Factory public static TypeMatcher<Boolean> asBoolean(Matcher<? extends Boolean> valueMatcher) { return new BooleanTypeMatcher(valueMatcher); }
TypeMatcher extends TypeSafeMatcher<String> { @Factory public static TypeMatcher<Boolean> asBoolean(Matcher<? extends Boolean> valueMatcher) { return new BooleanTypeMatcher(valueMatcher); } }
TypeMatcher extends TypeSafeMatcher<String> { @Factory public static TypeMatcher<Boolean> asBoolean(Matcher<? extends Boolean> valueMatcher) { return new BooleanTypeMatcher(valueMatcher); } TypeMatcher(Class<T> clazz, Matcher<? extends T> valueMatcher); }
TypeMatcher extends TypeSafeMatcher<String> { @Factory public static TypeMatcher<Boolean> asBoolean(Matcher<? extends Boolean> valueMatcher) { return new BooleanTypeMatcher(valueMatcher); } TypeMatcher(Class<T> clazz, Matcher<? extends T> valueMatcher); @Override void describeTo(Description description); @Factory static TypeMatcher<BigDecimal> asBigDecimal(Matcher<? extends BigDecimal> valueMatcher); @Factory static TypeMatcher<Double> asDouble(Matcher<? extends Double> valueMatcher); @Factory static TypeMatcher<Integer> asInt(Matcher<? extends Integer> valueMatcher); @Factory static TypeMatcher<Boolean> asBoolean(Matcher<? extends Boolean> valueMatcher); }
TypeMatcher extends TypeSafeMatcher<String> { @Factory public static TypeMatcher<Boolean> asBoolean(Matcher<? extends Boolean> valueMatcher) { return new BooleanTypeMatcher(valueMatcher); } TypeMatcher(Class<T> clazz, Matcher<? extends T> valueMatcher); @Override void describeTo(Description description); @Factory static TypeMatcher<BigDecimal> asBigDecimal(Matcher<? extends BigDecimal> valueMatcher); @Factory static TypeMatcher<Double> asDouble(Matcher<? extends Double> valueMatcher); @Factory static TypeMatcher<Integer> asInt(Matcher<? extends Integer> valueMatcher); @Factory static TypeMatcher<Boolean> asBoolean(Matcher<? extends Boolean> valueMatcher);  }