本文整理了Java中org.easymock.EasyMock.resetToStrict()
方法的一些代码示例,展示了EasyMock.resetToStrict()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EasyMock.resetToStrict()
方法的具体详情如下:
包路径:org.easymock.EasyMock
类名称:EasyMock
方法名:resetToStrict
[英]Resets the given mock objects (more exactly: the controls of the mock objects) and turn them to a mock with strict behavior. For details, see the EasyMock documentation.
[中]重置给定的模拟对象(更确切地说:模拟对象的控件),并将其转换为具有严格行为的模拟。有关详细信息,请参阅EasyMock文档。
代码示例来源:origin: confluentinc/ksql
@Test
public void shouldNotAttemptToCreateCommandTopicIfItExists() {
EasyMock.resetToStrict(topicClient);
EasyMock.expect(topicClient.isTopicExists(COMMAND_TOPIC)).andReturn(true);
EasyMock.expect(topicClient.addTopicConfig(anyObject(), anyObject())).andReturn(false);
EasyMock.replay(topicClient);
KsqlRestApplication.ensureCommandTopic(restConfig,
topicClient,
COMMAND_TOPIC);
EasyMock.verify(topicClient);
}
代码示例来源:origin: de.akquinet.jbosscc/jbosscc-needle
/**
* Resets the given mock objects and turns them to a mock with strict
* behavior. For details, see the EasyMock documentation.
*
* @param mocks
* the mock objects
*/
public void resetToStrict(final Object... mocks) {
EasyMock.resetToStrict(mocks);
}
代码示例来源:origin: de.akquinet.jbosscc/jbosscc-needle
/**
* Resets the given mock object and turns them to a mock with strict behavior.
* For details, see the EasyMock documentation.
*
* @param mock
* the mock objects
*
* @return the mock object
*/
@SuppressWarnings("unchecked")
public <X> X resetToStrict(final Object mock) {
EasyMock.resetToStrict(mock);
return (X) mock;
}
代码示例来源:origin: apache/httpcomponents-client
@Test
public void testRevalidationRewritesAbsoluteUri() throws Exception {
mockImplMethods(GET_CURRENT_DATE);
// Fail on an unexpected request, rather than causing a later NPE
EasyMock.resetToStrict(mockExecChain);
final ClassicHttpRequest validate = new HttpGet("http://foo.example.com/resource");
final ClassicHttpRequest relativeValidate = new BasicClassicHttpRequest("GET", "/resource");
final ClassicHttpResponse originResponse = new BasicClassicHttpResponse(HttpStatus.SC_OK, "Okay");
conditionalRequestBuilderReturns(validate);
getCurrentDateReturns(requestDate);
final ClassicHttpResponse resp = mockExecChain.proceed(
eqRequest(relativeValidate), isA(ExecChain.Scope.class));
expect(resp).andReturn(originResponse);
getCurrentDateReturns(responseDate);
replayMocks();
impl.revalidateCacheEntry(host, request, scope, mockExecChain, entry);
verifyMocks();
}
内容来源于网络,如有侵权,请联系作者删除!