HandlerProxy { public void openTable(String tableName) { Verify.isNotNullOrEmpty(tableName); this.tableName = tableName; store = storeFactory.createStore(tableName); table = store.openTable(this.tableName); } HandlerProxy(StoreFactory storeFactory); void createTable(String tableName,
                            byte[] serializedTableSchema, long autoInc); void dropTable(String tableName); void openTable(String tableName); void closeTable(); String getTableName(); void renameTable(final String originalName,
                            final String newName); long getRowCount(); void incrementRowCount(long amount); void truncateRowCount(); long getAutoIncrement(); void setAutoIncrement(long value); long incrementAutoIncrement(long amount); void truncateAutoIncrement(); void addIndex(String indexName, byte[] serializedSchema); void dropIndex(String indexName); boolean indexContainsDuplicate(String indexName, byte[] serializedRow); void insertRow(byte[] rowBytes); void deleteRow(byte[] rowBytes); void updateRow(byte[] oldRowBytes, byte[] rowBytes); void deleteAllRows(); void truncateTable(); void flush(); void startTableScan(); void startIndexScan(byte[] indexKeys); byte[] getNextRow(); byte[] getRow(byte[] uuid); void endScan();  }
@Test(expected = NullPointerException.class) public void testOpenTableInvalidTableName() { proxy.openTable(null); }
@Test(expected = IllegalArgumentException.class) public void testOpenTableEmptyTableName() { proxy.openTable(""); }
@Test public void testOpenTable() { when(storeFactory.createStore(anyString())).thenReturn(storageMock); when(storageMock.openTable(anyString())).thenReturn(tableMock); proxy.openTable(TEST_TABLE_NAME); verify(storeFactory, times(1)).createStore(eq(TEST_TABLE_NAME)); verify(storageMock, times(1)).openTable(eq(TEST_TABLE_NAME)); }