use of org.mockito.internal.matchers.Equals in project mockito by mockito.
the class InvocationMatcherTest method should_to_string_with_matchers.
@Test
public void should_to_string_with_matchers() throws Exception {
ArgumentMatcher m = NotNull.NOT_NULL;
InvocationMatcher notNull = new InvocationMatcher(new InvocationBuilder().toInvocation(), asList(m));
ArgumentMatcher mTwo = new Equals('x');
InvocationMatcher equals = new InvocationMatcher(new InvocationBuilder().toInvocation(), asList(mTwo));
assertThat(notNull.toString()).contains("simpleMethod(notNull())");
assertThat(equals.toString()).contains("simpleMethod('x')");
}
use of org.mockito.internal.matchers.Equals in project mockito by mockito.
the class InvocationMatcherTest method should_capture_arguments_from_invocation.
@Test
public void should_capture_arguments_from_invocation() throws Exception {
//given
Invocation invocation = new InvocationBuilder().args("1", 100).toInvocation();
CapturingMatcher capturingMatcher = new CapturingMatcher();
InvocationMatcher invocationMatcher = new InvocationMatcher(invocation, (List) asList(new Equals("1"), capturingMatcher));
//when
invocationMatcher.captureArgumentsFrom(invocation);
//then
assertEquals(1, capturingMatcher.getAllValues().size());
assertEquals(100, capturingMatcher.getLastValue());
}
use of org.mockito.internal.matchers.Equals in project jackrabbit-oak by apache.
the class TestS3Ds method testUpdateLastModifiedOnAccess.
/**----------Only run with org.apache.jackrabbit.oak.blob.cloud.aws.s3.S3DataStore-----------**/
@Override
public void testUpdateLastModifiedOnAccess() {
Assume.assumeThat(s3Class, new Equals(fixtures().get(1)));
super.testUpdateLastModifiedOnAccess();
}
use of org.mockito.internal.matchers.Equals in project jackrabbit-oak by apache.
the class TestS3Ds method testDeleteAllOlderThan.
@Override
public void testDeleteAllOlderThan() {
Assume.assumeThat(s3Class, new Equals(fixtures().get(1)));
super.testDeleteAllOlderThan();
}
Aggregations