Example #1
0
  public void createJsonFile() throws Exception {
    ItemStore itemStore = ItemStore.getInstance();

    Item.createAndStoreItem("path/to/file/one");
    Item.createAndStoreItem("path/to/file/two");
    Item.createAndStoreItem("path/to/file/three");

    ItemDaoJson.storeItems(itemStore.findAll(), jsonFile);
  }
Example #2
0
  public void testReadMap() throws Exception {
    // Given
    createJsonFile();

    // When
    List<Item> items = ItemDaoJson.readItems(jsonFile);

    // Then
    assertNotNull(items);
    assertEquals(3, items.size());
  }