1/*
2 * Copyright (c) 2007 Mockito contributors
3 * This program is made available under the terms of the MIT License.
4 */
5
6package org.mockito.internal.verification;
7
8import org.junit.Before;
9import org.junit.Test;
10import org.mockito.internal.invocation.InvocationBuilder;
11import org.mockito.invocation.Invocation;
12import org.mockitoutil.TestBase;
13
14import static junit.framework.TestCase.assertFalse;
15import static junit.framework.TestCase.assertTrue;
16
17public class DefaultRegisteredInvocationsTest extends TestBase {
18
19    private DefaultRegisteredInvocations invocations;
20
21    @Before
22    public void setup() {
23        invocations = new DefaultRegisteredInvocations();
24    }
25
26    @Test
27    public void should_not_return_to_string_method() throws Exception {
28        Invocation toString = new InvocationBuilder().method("toString").toInvocation();
29        Invocation simpleMethod = new InvocationBuilder().simpleMethod().toInvocation();
30
31        invocations.add(toString);
32        invocations.add(simpleMethod);
33
34        assertTrue(invocations.getAll().contains(simpleMethod));
35        assertFalse(invocations.getAll().contains(toString));
36    }
37}
38