T
- the type of ConditionBean implementaionpublic class BehaviorArgumentMatcher<T extends org.dbflute.cbean.ConditionBean> extends BaseMatcher<org.dbflute.bhv.readable.CBCall<T>>
This class is similar to ArgumentMatcher
, but this is not an abstract class.
This matcher delegates evaluation to supplied Matcher
by calling Matcher.matches(Object)
with captured ConditionBean.
Consider to use DBFluteMatchers.argCB(Class, Matcher)
in your convenience.
// stubbing
when(bhv.selectEntity(argThat(new BehaviorArgumentMatcher(MemberCB.class
, hasCondition("memberId", equal(1)))))).thenReturn(fixture);
// verification
verify(mockBhv).selectEntity(argThat(new BehaviorArgumentMatcher(MemberCB.class
, hasCondition("memberId", equal(1)))));
// convenient static method
when(bhv.selectEntity(argCB(MemberCB.class, hasCondition("memberId", equal(1))))).thenReturn(fixture);
verify(mockBhv).selectEntity(argCB(MemberCB.class, hasCondition("memberId", equal(1))));
DBFluteMatchers.argCB(Class, Matcher)
コンストラクタと説明 |
---|
BehaviorArgumentMatcher(Class<T> cbclass,
Matcher<T> matcher)
Creates a new instance that evaluates
cbclass argument with matcher . |
修飾子とタイプ | メソッドと説明 |
---|---|
void |
describeMismatch(Object item,
Description description) |
void |
describeTo(Description description) |
boolean |
matches(Object item)
Creates a new
T instance by reflection and pass it to subsequent matcher. |
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
public boolean matches(Object item)
T
instance by reflection and pass it to subsequent matcher.public void describeTo(Description description)
public void describeMismatch(Object item, Description description)
describeMismatch
インタフェース内 Matcher<org.dbflute.bhv.readable.CBCall<T extends org.dbflute.cbean.ConditionBean>>
describeMismatch
クラス内 BaseMatcher<org.dbflute.bhv.readable.CBCall<T extends org.dbflute.cbean.ConditionBean>>
Copyright © 2015 The DBFlute Project. All rights reserved.