本文整理汇总了Java中org.mockito.internal.progress.MockingProgress类的典型用法代码示例。如果您正苦于以下问题:Java MockingProgress类的具体用法?Java MockingProgress怎么用?Java MockingProgress使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MockingProgress类属于org.mockito.internal.progress包,在下文中一共展示了MockingProgress类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MocksCollector
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
public MocksCollector() {
createdMocks = new LinkedList<Object>();
final MockingProgress progress = new ThreadSafeMockingProgress();
progress.setListener(new CollectCreatedMocks(createdMocks));
}
示例2: Verification
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
Verification(Object target) {
MockUtil mockUtil = new MockUtil();
InternalMockHandler<?> handler = mockUtil.getMockHandler(target);
InvocationContainer container = handler.getInvocationContainer();
Field field = ReflectionUtils.findField(container.getClass(),
"mockingProgress");
ReflectionUtils.makeAccessible(field);
this.progress = (MockingProgress) ReflectionUtils.getField(field, container);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:MockitoAopProxyTargetInterceptor.java
示例3: getVerificationMode
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
private VerificationMode getVerificationMode() {
try {
MockingProgress progress = (MockingProgress) Whitebox.invokeMethod(ThreadSafeMockingProgress.class,
"threadSafely");
return getVerificationModeFromMockProgress(progress);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
示例4: getVerificationModeFromMockProgress
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private VerificationMode getVerificationModeFromMockProgress(MockingProgress mockingProgress) {
if (mockingProgress == null) {
return null;
}
if (mockingProgress instanceof ThreadSafeMockingProgress) {
ThreadLocal<MockingProgress> threadLocal = Whitebox.getInternalState(mockingProgress, ThreadLocal.class);
return getVerificationModeFromMockProgress(threadLocal.get());
} else {
Localized<VerificationMode> verificationMode = Whitebox.getInternalState(mockingProgress, Localized.class);
return verificationMode == null ? null : verificationMode.getObject();
}
}
示例5: getMockingProgress
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
private MockingProgress getMockingProgress() {
return Whitebox.getInternalState(Mockito.class, MockingProgress.class);
}
示例6: MocksCollector
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
public MocksCollector() {
createdMocks = new LinkedList<>();
final MockingProgress progress = new ThreadSafeMockingProgress();
progress.setListener(new CollectCreatedMocks(createdMocks));
}
示例7: InvocationContainerImpl
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
public InvocationContainerImpl(MockingProgress mockingProgress) {
this.mockingProgress = mockingProgress;
}
示例8: WarningsCollector
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
public WarningsCollector() {
createdMocks = new LinkedList();
MockingProgress progress = new ThreadSafeMockingProgress();
progress.setListener(new CollectCreatedMocks(createdMocks));
}
示例9: InvocationContainerImpl
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
public InvocationContainerImpl(MockingProgress mockingProgress, MockCreationSettings mockSettings) {
this.mockingProgress = mockingProgress;
this.registeredInvocations = createRegisteredInvocations(mockSettings);
}
示例10: verifyPrivate
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
/**
* Verify a private method invocation with a given verification mode.
*
* @see {@link Mockito#verify(Object)}
* @throws Exception
* If something unexpected goes wrong.
*/
public static PrivateMethodVerification verifyPrivate(Object object, VerificationMode verificationMode)
throws Exception {
Whitebox.getInternalState(Mockito.class, MockingProgress.class).verificationStarted(
POWERMOCKITO_CORE.wrapInMockitoSpecificVerificationMode(object, verificationMode));
return new DefaultPrivateMethodVerification(object);
}
示例11: verifyStatic
import org.mockito.internal.progress.MockingProgress; //导入依赖的package包/类
/**
* Verifies certain behavior happened at least once / exact number of times
* / never. E.g:
*
* <pre>
* verifyStatic(times(5));
* ClassWithStaticMethod.someStaticMethod("was called five times");
*
* verifyStatic(atLeast(2));
* ClassWithStaticMethod.someStaticMethod("was called at least two times");
*
* //you can use flexible argument matchers, e.g:
* verifyStatic(atLeastOnce());
* ClassWithStaticMethod.someMethod(<b>anyString()</b>);
* </pre>
*
* <b>times(1) is the default</b> and can be omitted
* <p>
*
* @param verificationMode
* times(x), atLeastOnce() or never()
*/
public static synchronized void verifyStatic(VerificationMode verificationMode) {
Whitebox.getInternalState(Mockito.class, MockingProgress.class).verificationStarted(
POWERMOCKITO_CORE.wrapInStaticVerificationMode(verificationMode));
}