itemskeptondeath: Fix tests

This commit is contained in:
Owain van Brakel
2019-08-04 03:16:02 +02:00
parent fa0a16c2d8
commit c5494b9aa1

View File

@@ -41,7 +41,6 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -82,9 +81,20 @@ public class ItemsKeptOnDeathPluginTest
{
// Mock Item Composition and necessary ItemManager methods for this item
ItemDefinition c = mock(ItemDefinition.class);
when(c.getId())
.thenReturn(id);
when(c.getName())
.thenReturn(name);
when(c.isTradeable())
.thenReturn(tradeable);
when(c.getPrice())
.thenReturn(price);
if (!tradeable)
{
when(c.getNote()).thenReturn(-1);
when(c.getLinkedNoteId()).thenReturn(-1);
}
when(itemManager.getItemDefinition(id)).thenReturn(c);
when(itemManager.canonicalize(id)).thenReturn(id);