result = targetAds(conn, new String[]{"VA"}, "wooooo");
assert "2".equals(result.getValue1());
Iterator<Tuple> range = conn.zrangeWithScores("idx:ad:value:", 0, -1).iterator();
assert new Tuple("2", 0.125).equals(range.next());
assert new Tuple("1", 0.25).equals(range.next());
range = conn.zrangeWithScores("ad:base_value:", 0, -1).iterator();
assert new Tuple("2", 0.125).equals(range.next());
assert new Tuple("1", 0.25).equals(range.next());
recordClick(conn, targetId, adId, false);
range = conn.zrangeWithScores("idx:ad:value:", 0, -1).iterator();
assert new Tuple("2", 0.125).equals(range.next());
assert new Tuple("1", 2.5).equals(range.next());
range = conn.zrangeWithScores("ad:base_value:", 0, -1).iterator();
assert new Tuple("2", 0.125).equals(range.next());
assert new Tuple("1", 0.25).equals(range.next());
}