@Test(priority = 1)
public void testUpdate() {

  ClientConfig config = ClientConfig.loadFromClasspath(AuditDBConstants.FEEDER_CONF_FILE);
  AuditDBHelper helper = new AuditDBHelper(config);
  String selectStmt = helper.getSelectStmtForUpdation();
  PreparedStatement selectStatement = null;
  ResultSet rs = null;
  try {
    selectStatement = connection.prepareStatement(selectStmt);
    rs = getResultSetOfQuery(selectStatement, tuple1);
    Assert.assertNotNull(rs);
    Assert.assertFalse(rs.next());
    Assert.assertTrue(helper.update(tupleSet1));
    rs = getResultSetOfQuery(selectStatement, tuple1);
    Assert.assertNotNull(rs);
    Assert.assertTrue(rs.next());
    Assert.assertEquals(tuple1.getSent(), rs.getLong(AuditDBConstants.SENT));
    for (LatencyColumns latencyColumns : LatencyColumns.values()) {
      Long val = tuple1.getLatencyCountMap().get(latencyColumns);
      if (val == null)
        val = 0l;
      Assert.assertEquals(val, (Long) rs.getLong(latencyColumns.toString()));
    }
    Assert.assertEquals(tuple1.getLostCount(),
        (Long) rs.getLong(LatencyColumns.C600.toString()));
    Assert.assertTrue(helper.update(tupleSet2));
    rs = getResultSetOfQuery(selectStatement, tuple1);
    Assert.assertNotNull(rs);
    Assert.assertTrue(rs.next());
    Assert.assertEquals(tuple1.getSent() + tuple2.getSent(),
        rs.getLong(AuditDBConstants.SENT));
    for (LatencyColumns latencyColumns : LatencyColumns.values()) {
      Long val1 = tuple1.getLatencyCountMap().get(latencyColumns);
      if (val1 == null)
        val1 = 0l;
      Long val2 = tuple2.getLatencyCountMap().get(latencyColumns);
      if (val2 == null)
        val2 = 0l;
      Assert.assertEquals(val1 + val2, rs.getLong(latencyColumns
          .toString()));
    }
    Assert.assertEquals(tuple1.getLostCount() + tuple2.getLostCount(),
        rs.getLong(LatencyColumns.C600.toString()));
    Assert.assertTrue(helper.update(tupleSet3));
  } catch (SQLException e) {
    e.printStackTrace();
  } finally {
    try {
      if (rs != null) {
        rs.close();
      }
      if (selectStatement != null) {
        selectStatement.close();
      }
    } catch (SQLException e) {
      e.printStackTrace();
    }
  }
}