If value is not supposed to be a String, but an int, double or anything, MockHTable.toEString()
can be used to turn it into a String.
In order to simplify assertions for tests that should put anything into database, MockHTable.read() works with two parameters (id and column) and returns anything written to that row/column. So, previous test can be reduced to
@Test public void testSave() { MockHTable table = MockHTable.create(); MyDAO(table).saveData(id, data); assertArrayEquals(data, table.read(id, "family:qualifier")); }
@author erdem
|
|