CB
- Type of ConditionBean implementationpublic class BehaviorArgumentCaptor<CB extends org.dbflute.cbean.ConditionBean> extends Object
This captor captures Behavior's lambda argument by using an internal ArgumentCaptor
.
When getCB()
was called, it creates a new CB
instance and applies lambda and then returns it.
Example of capturing ConditionBean:
BehaviorArgumentCaptor<MemberCB> captor = BehaviorArgumentCaptor.of(MemberCB.class);
verify(mockBhv).selectEntity(captor.capture());
MemberCB cb = captor.getCB();
assertThat(cb, hasCondition("memberId", equal(1)));
コンストラクタと説明 |
---|
BehaviorArgumentCaptor(Class<CB> clazz)
Creates a new
BehaviorArgumentCaptor of clazz . |
修飾子とタイプ | メソッドと説明 |
---|---|
org.dbflute.bhv.readable.CBCall<CB> |
capture()
Returns captor to capture argument.
|
List<CB> |
getAllCB()
Returns new
CB instances that were applied lambda callback. |
CB |
getCB()
Returns a new
CB instance that was applied lambda callback. |
static <CB extends org.dbflute.cbean.ConditionBean> |
of(Class<CB> clazz)
Create a new
BehaviorArgumentCaptor of clazz . |
public BehaviorArgumentCaptor(Class<CB> clazz)
BehaviorArgumentCaptor
of clazz
.clazz
- Implementation class of ConditionBeanpublic org.dbflute.bhv.readable.CBCall<CB> capture()
ArgumentCaptor.capture()
public CB getCB()
CB
instance that was applied lambda callback.
If verified method was called multiple times, this method returns the latest one.
If you want to get all ConditionBean, use getAllCB()
method instead.
CB
getAllCB()
,
ArgumentCaptor.getValue()
public List<CB> getAllCB()
CB
instances that were applied lambda callback.CB
instances.ArgumentCaptor.getAllValues()
public static <CB extends org.dbflute.cbean.ConditionBean> BehaviorArgumentCaptor<CB> of(Class<CB> clazz)
BehaviorArgumentCaptor
of clazz
.clazz
- Class of ConditionBean implementation.Copyright © 2015 The DBFlute Project. All rights reserved.