当前位置: 首页>>代码示例>>Java>>正文


Java Matchers.argThat方法代码示例

本文整理汇总了Java中org.mockito.Matchers.argThat方法的典型用法代码示例。如果您正苦于以下问题:Java Matchers.argThat方法的具体用法?Java Matchers.argThat怎么用?Java Matchers.argThat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.mockito.Matchers的用法示例。


在下文中一共展示了Matchers.argThat方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: build

import org.mockito.Matchers; //导入方法依赖的package包/类
/**
 * @return Mockito Matcher
 */
public BugInstance build() {

    //JSP line to Java source conversion
    List<Integer> multipleChoicesLine = null;
    if(jspLine != null) {
        if(jspFile != null) {
            //Map JSP lines to Java base on the smap file if available
            multipleChoicesLine = mapJspToJavaLine(jspFile,jspLine);
        }
        else {
            throw new RuntimeException("JSP file not set.");
        }
    }

    return Matchers.argThat(new BugInstanceMatcher(bugType, className, methodName, fieldName, lineNumber, lineNumberApprox, priority, jspFile, multipleChoicesLine));
}
 
开发者ID:blackarbiter,项目名称:Android_Code_Arbiter,代码行数:20,代码来源:BugInstanceMatcherBuilder.java

示例2: ownershipChange

import org.mockito.Matchers; //导入方法依赖的package包/类
static DOMEntityOwnershipChange ownershipChange(final DOMEntity expEntity, final boolean expWasOwner,
        final boolean expIsOwner, final boolean expHasOwner, final boolean expInJeopardy) {
    return Matchers.argThat(new ArgumentMatcher<DOMEntityOwnershipChange>() {
        @Override
        public boolean matches(Object argument) {
            DOMEntityOwnershipChange change = (DOMEntityOwnershipChange) argument;
            return expEntity.equals(change.getEntity()) && expWasOwner == change.getState().wasOwner()
                    && expIsOwner == change.getState().isOwner() && expHasOwner == change.getState().hasOwner()
                    && expInJeopardy == change.inJeopardy();
        }

        @Override
        public void describeTo(Description description) {
            description.appendValue(new DOMEntityOwnershipChange(expEntity, EntityOwnershipChangeState.from(
                    expWasOwner, expIsOwner, expHasOwner), expInJeopardy));
        }
    });
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:19,代码来源:AbstractEntityOwnershipTest.java

示例3: updateElectionTerm

import org.mockito.Matchers; //导入方法依赖的package包/类
static UpdateElectionTerm updateElectionTerm(final long term, final String votedFor) {
    return Matchers.argThat(new ArgumentMatcher<UpdateElectionTerm>() {
        @Override
        public boolean matches(Object argument) {
            UpdateElectionTerm other = (UpdateElectionTerm) argument;
            return term == other.getCurrentTerm() && votedFor.equals(other.getVotedFor());
        }

        @Override
        public void describeTo(Description description) {
            description.appendValue(new UpdateElectionTerm(term, votedFor));
        }
    });
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:15,代码来源:RaftActorRecoverySupportTest.java

示例4: domDataTreeIdentifier

import org.mockito.Matchers; //导入方法依赖的package包/类
static DOMDataTreeIdentifier domDataTreeIdentifier(final YangInstanceIdentifier yangID) {
    return Matchers.argThat(new ArgumentMatcher<DOMDataTreeIdentifier>() {
        @Override
        public boolean matches(final Object argument) {
            final DOMDataTreeIdentifier treeId = (DOMDataTreeIdentifier) argument;
            return (treeId.getDatastoreType() == LogicalDatastoreType.CONFIGURATION) &&
                    yangID.equals(treeId.getRootIdentifier());
        }

        @Override
        public void describeTo(final Description description) {
            description.appendValue(new DOMDataTreeIdentifier(LogicalDatastoreType.CONFIGURATION, yangID));
        }
    });
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:16,代码来源:BindingDOMDataTreeChangeServiceAdapterTest.java


注:本文中的org.mockito.Matchers.argThat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。