HandlerProxy { public void dropIndex(String indexName) { Verify.isNotNullOrEmpty(indexName, "The index name is invalid"); checkTableOpen(); TableSchema tableSchema = store.getSchema(tableName); IndexSchema indexSchema = tableSchema.getIndexSchema(indexName); table.deleteTableIndex(indexSchema); store.dropIndex(tableName, indexName); } 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 testDropIndexInvalidIndexName() { proxy.dropIndex(null); }
@Test(expected = IllegalArgumentException.class) public void testDropIndexEmptyIndexName() { proxy.dropIndex(""); }
@Test public void testDropIndex() { 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)); when(storageMock.getSchema(TEST_TABLE_NAME)).thenReturn(TABLE_SCHEMA); proxy.dropIndex(TEST_INDEX); verify(storageMock, times(1)).getSchema(eq(TEST_TABLE_NAME)); verify(tableMock, times(1)).deleteTableIndex(eq(INDEX_SCHEMA)); verify(storageMock, times(1)).dropIndex(eq(TEST_TABLE_NAME), eq(TEST_INDEX)); }