Ejemplo n.º 1
0
  @Override
  public void update() {
    String cid = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa3";
    Long fid = Long.valueOf(0);
    String username = "******";
    String collection_name = "testCollection";
    FileScanner fs = dao.read(fid);
    Collection collection = new Collection();
    collection.setUUID(cid);
    collection.setName(collection_name);

    assertNotEquals(fs.getUsername(), username);
    fs.setUsername(username);
    fs.getCollections().add(collection);
    dao.update(fs);

    fs = dao.read(fid);
    assertEquals(fs.getUsername(), username);
    assertEquals(fs.getCollections().size(), 3);
    assertTrue(fs.getCollections().contains(collection));
  }