Package org.mockito.internal.verification

Examples of org.mockito.internal.verification.Times


        globalHttpHeadersRequestFilter.filterAbstractHttpRequest(context, request);
        globalHttpHeadersRequestFilter.afterAbstractHttpResponse(context, request);

        ArgumentCaptor<StringToStringsMap> headers = ArgumentCaptor.forClass(StringToStringsMap.class);
        Mockito.verify(request, new Times(2)).setRequestHeaders(headers.capture());

        // first headers should contain the added header
        Assert.assertEquals("Testing", headers.getAllValues().get(0).get("User-Agent").get(0));

        // and the second should contain nothing
View Full Code Here


        globalHttpHeadersRequestFilter.filterAbstractHttpRequest(context, request);
        globalHttpHeadersRequestFilter.afterAbstractHttpResponse(context, request);

        ArgumentCaptor<StringToStringsMap> headers = ArgumentCaptor.forClass(StringToStringsMap.class);
        Mockito.verify(request, new Times(2)).setRequestHeaders(headers.capture());

        // check that the headers has been added
        Assert.assertEquals("Existing header", headers.getAllValues().get(0).get("User-Agent").get(0));
        Assert.assertEquals("Testing", headers.getAllValues().get(0).get("User-Agent").get(1));
View Full Code Here

        globalHttpHeadersRequestFilter.filterAbstractHttpRequest(context, request);
        globalHttpHeadersRequestFilter.afterAbstractHttpResponse(context, request);

        ArgumentCaptor<StringToStringsMap> headers = ArgumentCaptor.forClass(StringToStringsMap.class);
        Mockito.verify(request, new Times(2)).setRequestHeaders(headers.capture());

        // check that the header has been added
        Assert.assertEquals("Testing", headers.getAllValues().get(0).get("User-Agent").get(0));
        Assert.assertEquals(1, headers.getAllValues().get(0).size());
View Full Code Here

        gossip.update(state3, address3);
        gossip.update(state4, address4);
        gossip.update(state4, address4);

        verify(communications).setGossip(gossip);
        verify(communications, new Times(16)).getLocalAddress();

        verifyNoMoreInteractions(communications);

        verify(receiver).register(eq(state1.state.getId()), isA(byte[].class));
        verify(receiver).register(eq(state2.state.getId()), isA(byte[].class));
View Full Code Here

        verify(communications).handlerFor(eq(address2));
        verify(communications).handlerFor(eq(address3));
        verify(communications).handlerFor(eq(address4));

        verify(communications).setGossip(gossip);
        verify(communications, new Times(9)).getLocalAddress();

        verifyNoMoreInteractions(communications);

        verify(receiver).register(eq(state1.state.getId()),
                                  eq(state1.state.getState()));
View Full Code Here

        verify(ep4).updateState(state4, gossip);
        verifyNoMoreInteractions(ep4);

        verify(communications).setGossip(gossip);

        verify(communications, new Times(5)).getLocalAddress();
        verifyNoMoreInteractions(communications);
    }
View Full Code Here

        Mockito.verify(item, new AtLeast(0)).getComponent(ItemComponent.class);
        Mockito.verify(item, new AtLeast(0)).exists();
        Mockito.verify(item, new AtLeast(0)).iterateComponents();
        Mockito.verify(inventory, new AtLeast(0)).getComponent(InventoryComponent.class);
        Mockito.verify(inventory).saveComponent(inventoryComp);
        Mockito.verify(inventory, new Times(2)).send(Matchers.any(BeforeItemRemovedFromInventory.class));
        Mockito.verify(inventory, new Times(2)).send(Matchers.any(InventorySlotChangedEvent.class));

        Mockito.verifyNoMoreInteractions(instigator, inventory, entityManager, item);
    }
View Full Code Here

        Mockito.verify(item, new AtLeast(0)).getComponent(ItemComponent.class);
        Mockito.verify(item, new AtLeast(0)).exists();
        Mockito.verify(item).destroy();
        Mockito.verify(inventory, new AtLeast(0)).getComponent(InventoryComponent.class);
        Mockito.verify(inventory).saveComponent(inventoryComp);
        Mockito.verify(inventory, new Times(2)).send(Matchers.any(BeforeItemRemovedFromInventory.class));
        Mockito.verify(inventory, new Times(2)).send(Matchers.any(InventorySlotChangedEvent.class));

        Mockito.verifyNoMoreInteractions(instigator, inventory, entityManager, item);
    }
View Full Code Here

        Mockito.verify(item2, new AtLeast(0)).getComponent(ItemComponent.class);
        Mockito.verify(item2, new AtLeast(0)).iterateComponents();
        Mockito.verify(item2).saveComponent(itemComp2);
        Mockito.verify(inventory, new AtLeast(0)).getComponent(InventoryComponent.class);
        Mockito.verify(inventory).saveComponent(inventoryComp);
        Mockito.verify(inventory, new Times(3)).send(Matchers.any(BeforeItemRemovedFromInventory.class));
        Mockito.verify(inventory, new Times(3)).send(Matchers.any(InventorySlotChangedEvent.class));
        Mockito.verify(inventory, new Times(3)).send(Matchers.any(InventorySlotStackSizeChangedEvent.class));

        Mockito.verifyNoMoreInteractions(instigator, inventory, entityManager, item1, item2);
    }
View Full Code Here

        Mockito.verify(item2, new AtLeast(0)).getComponent(ItemComponent.class);
        Mockito.verify(item2, new AtLeast(0)).iterateComponents();
        Mockito.verify(item2).saveComponent(itemComp2);
        Mockito.verify(inventory, new AtLeast(0)).getComponent(InventoryComponent.class);
        Mockito.verify(inventory).saveComponent(inventoryComp);
        Mockito.verify(inventory, new Times(3)).send(Matchers.any(BeforeItemRemovedFromInventory.class));
        Mockito.verify(inventory, new Times(3)).send(Matchers.any(InventorySlotChangedEvent.class));
        Mockito.verify(inventory, new Times(3)).send(Matchers.any(InventorySlotStackSizeChangedEvent.class));

        Mockito.verifyNoMoreInteractions(instigator, inventory, entityManager, item1, item2);
    }
View Full Code Here

TOP

Related Classes of org.mockito.internal.verification.Times

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.