Package org.mockito.internal.verification

Examples of org.mockito.internal.verification.AtLeast


        inventoryAuthoritySystem.removeItem(action, inventory);

        assertEquals(1, itemComp.stackCount);
        assertEquals(1, itemCompCopy.stackCount);

        Mockito.verify(item, new AtLeast(0)).getComponent(ItemComponent.class);
        Mockito.verify(item, new AtLeast(0)).iterateComponents();
        Mockito.verify(item).saveComponent(itemComp);
        Mockito.verify(itemCopy, new AtLeast(0)).getComponent(ItemComponent.class);
        Mockito.verify(itemCopy, new AtLeast(0)).iterateComponents();
        Mockito.verify(itemCopy).saveComponent(itemCompCopy);
        Mockito.verify(inventory, new AtLeast(0)).getComponent(InventoryComponent.class);
        Mockito.verify(inventory).send(Matchers.any(InventorySlotStackSizeChangedEvent.class));
        Mockito.verify(entityManager).copy(item);

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


        assertTrue(action.isConsumed());
        assertEquals(item, action.getRemovedItem());

        assertEquals(EntityRef.NULL, inventoryComp.itemSlots.get(0));

        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

        RemoveItemAction action = new RemoveItemAction(instigator, item, true, 1);
        inventoryAuthoritySystem.removeItem(action, inventory);

        assertEquals(1, itemComp.stackCount);

        Mockito.verify(item, new AtLeast(0)).getComponent(ItemComponent.class);
        Mockito.verify(item).saveComponent(itemComp);
        Mockito.verify(inventory, new AtLeast(0)).getComponent(InventoryComponent.class);
        Mockito.verify(inventory).send(Matchers.any(InventorySlotStackSizeChangedEvent.class));

        Mockito.verifyNoMoreInteractions(instigator, inventory, entityManager, item);

        assertTrue(action.isConsumed());
View Full Code Here

        assertTrue(action.isConsumed());
        assertNull(action.getRemovedItem());

        assertEquals(EntityRef.NULL, inventoryComp.itemSlots.get(0));

        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

        assertEquals(3, itemComp1.stackCount);
        assertEquals(1, itemComp2.stackCount);
        assertTrue(action.isConsumed());
        assertEquals(item1, action.getRemovedItem());

        Mockito.verify(item1, new AtLeast(0)).getComponent(ItemComponent.class);
        Mockito.verify(item1, new AtLeast(0)).exists();
        Mockito.verify(item1, new AtLeast(0)).iterateComponents();
        Mockito.verify(item1).saveComponent(itemComp1);
        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));
View Full Code Here

        assertEquals(EntityRef.NULL, inventoryComp.itemSlots.get(0));
        assertEquals(1, itemComp2.stackCount);
        assertTrue(action.isConsumed());
        assertNull(action.getRemovedItem());

        Mockito.verify(item1, new AtLeast(0)).getComponent(ItemComponent.class);
        Mockito.verify(item1, new AtLeast(0)).exists();
        Mockito.verify(item1, new AtLeast(0)).iterateComponents();
        Mockito.verify(item1).destroy();
        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));
View Full Code Here

        inventoryAuthoritySystem.removeItem(action, inventory);

        assertFalse(action.isConsumed());
        assertNull(action.getRemovedItem());

        Mockito.verify(item, new AtLeast(0)).getComponent(ItemComponent.class);
        Mockito.verify(item, new AtLeast(0)).exists();
        Mockito.verify(inventory, new AtLeast(0)).getComponent(InventoryComponent.class);
        Mockito.verify(inventory).send(Matchers.any(BeforeItemRemovedFromInventory.class));

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

        setupItemRef(item, itemComp, 2, 10);

        GiveItemAction action = new GiveItemAction(instigator, item);
        inventoryAuthoritySystem.giveItem(action, inventory);

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

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

        inventoryComp.itemSlots.set(0, partialItem);

        GiveItemAction action = new GiveItemAction(instigator, item);
        inventoryAuthoritySystem.giveItem(action, inventory);

        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(item).destroy();
        Mockito.verify(partialItem, new AtLeast(0)).getComponent(ItemComponent.class);
        Mockito.verify(partialItem, new AtLeast(0)).exists();
        Mockito.verify(partialItem, new AtLeast(0)).iterateComponents();
        Mockito.verify(partialItem).saveComponent(partialItemComp);
        Mockito.verify(inventory, new AtLeast(0)).getComponent(InventoryComponent.class);
        Mockito.verify(inventory).send(Matchers.any(InventorySlotStackSizeChangedEvent.class));

        Mockito.verifyNoMoreInteractions(instigator, inventory, entityManager, item, partialItem);

        assertEquals(partialItem, inventoryComp.itemSlots.get(0));
View Full Code Here

        inventoryComp.itemSlots.set(0, partialItem);

        GiveItemAction action = new GiveItemAction(instigator, item);
        inventoryAuthoritySystem.giveItem(action, inventory);

        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(item).saveComponent(itemComp);
        Mockito.verify(partialItem, new AtLeast(0)).getComponent(ItemComponent.class);
        Mockito.verify(partialItem, new AtLeast(0)).exists();
        Mockito.verify(partialItem, new AtLeast(0)).iterateComponents();
        Mockito.verify(partialItem).saveComponent(partialItemComp);
        Mockito.verify(inventory, new AtLeast(0)).getComponent(InventoryComponent.class);
        Mockito.verify(inventory).saveComponent(inventoryComp);
        Mockito.verify(inventory, new Times(3)).send(Matchers.any(InventorySlotStackSizeChangedEvent.class));
        Mockito.verify(inventory, new Times(3)).send(Matchers.any(InventorySlotChangedEvent.class));
        Mockito.verify(inventory, new Times(3)).send(Matchers.any(BeforeItemPutInInventory.class));
View Full Code Here

TOP

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

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.