aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiederick de Vries <diederick@diederickdevries.net>2019-08-02 15:02:07 +0200
committerDiederick de Vries <diederick@diederickdevries.net>2019-08-02 15:02:07 +0200
commit7b2411f1e38a0a62f0e6f62f70fe1e42f05f678b (patch)
tree1cd13dd598b6c4ab878c34aa9f5de11e996396dd
parent1202f70afe727d6cecd28d1bf7aa26b49ab63a24 (diff)
downloadboodschapi-7b2411f1e38a0a62f0e6f62f70fe1e42f05f678b.tar.gz
boodschapi-7b2411f1e38a0a62f0e6f62f70fe1e42f05f678b.tar.bz2
boodschapi-7b2411f1e38a0a62f0e6f62f70fe1e42f05f678b.zip
test: a bought item that is re-added to the list should no longer be considered to be bought.
-rw-r--r--src/test/java/net/diederickdevries/boodschapi/controller/ItemControllerIT.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/java/net/diederickdevries/boodschapi/controller/ItemControllerIT.java b/src/test/java/net/diederickdevries/boodschapi/controller/ItemControllerIT.java
index 09c41de..f3d57fe 100644
--- a/src/test/java/net/diederickdevries/boodschapi/controller/ItemControllerIT.java
+++ b/src/test/java/net/diederickdevries/boodschapi/controller/ItemControllerIT.java
@@ -18,6 +18,7 @@
18 */ 18 */
19package net.diederickdevries.boodschapi.controller; 19package net.diederickdevries.boodschapi.controller;
20 20
21import java.net.URISyntaxException;
21import javax.transaction.Transactional; 22import javax.transaction.Transactional;
22import net.diederickdevries.boodschapi.model.Category; 23import net.diederickdevries.boodschapi.model.Category;
23import net.diederickdevries.boodschapi.model.Grocery; 24import net.diederickdevries.boodschapi.model.Grocery;
@@ -102,4 +103,18 @@ public class ItemControllerIT
102 103
103 assertEquals("ID of the grocery the bought item represents", null, unboughtGrocery.getBought()); 104 assertEquals("ID of the grocery the bought item represents", null, unboughtGrocery.getBought());
104 } 105 }
106
107 /**
108 * Tests that a bought item that is re-added to the list is no longer considered bought.
109 *
110 * @throws URISyntaxException
111 */
112 @Test
113 public void testRebuy() throws URISyntaxException
114 {
115 controller.buy(testItem.getId(), 1483349618L);
116 controller.add(testItem.getGrocery().getId(), jumbo.getId(), "200001");
117 assertNull("Item should no longer be bought", testItem.getBought());
118 }
119
105} \ No newline at end of file 120} \ No newline at end of file