Search in sources :

Example 1 with MockHTable

use of com.nearinfinity.honeycomb.MockHTable in project honeycomb by altamiracorp.

the class MutationFactoryTest method testSetup.

@Before
public void testSetup() {
    HBaseTableFactory tableFactory = mock(HBaseTableFactory.class);
    HTableProvider provider = mock(HTableProvider.class);
    MockitoAnnotations.initMocks(this);
    MockHTable table = MockHTable.create();
    when(provider.get()).thenReturn(table);
    HBaseMetadata metadata = new HBaseMetadata(provider);
    metadata.setColumnFamily("nic");
    MetadataCache cache = new MetadataCache(metadata);
    HBaseStore store = new HBaseStore(metadata, tableFactory, cache);
    factory = new MutationFactory(store);
    factory.setColumnFamily("nic");
    TableSchema schema = new TableSchema(COLUMNS, INDICES);
    store.createTable(TABLE, schema);
    tableId = store.getTableId(TABLE);
}
Also used : TableSchema(com.nearinfinity.honeycomb.mysql.schema.TableSchema) MockHTable(com.nearinfinity.honeycomb.MockHTable) Before(org.junit.Before)

Aggregations

MockHTable (com.nearinfinity.honeycomb.MockHTable)1 TableSchema (com.nearinfinity.honeycomb.mysql.schema.TableSchema)1 Before (org.junit.Before)1