RowMutationsAdapter extends MutationAdapter<RowMutations> { @Override public void adapt( RowMutations operation, com.google.cloud.bigtable.data.v2.models.MutationApi<?> mutationApi) { for (Mutation mutation : operation.getMutations()) { mutationAdapter.adapt(mutation, mutationApi); } } RowMutationsAdapter(MutationAdapter<Mutation> mutationAdapter); @Override void adapt(
      RowMutations operation, com.google.cloud.bigtable.data.v2.models.MutationApi<?> mutationApi);  }
@Test public void testRowKeyIsSet() { byte[] rowKey = dataHelper.randomData("rk-1"); RowMutations mutations = new RowMutations(rowKey); com.google.cloud.bigtable.data.v2.models.Mutation mutation = com.google.cloud.bigtable.data.v2.models.Mutation.create(); adapter.adapt(mutations, mutation); MutateRowRequest result = toMutateRowRequest(rowKey, mutation); Assert.assertArrayEquals(rowKey, result.getRowKey().toByteArray()); }
@Test public void testMultipleMutationsAreAdapted() throws IOException { byte[] rowKey = dataHelper.randomData("rk-1"); RowMutations mutations = new RowMutations(rowKey); byte[] family1 = dataHelper.randomData("cf1"); byte[] qualifier1 = dataHelper.randomData("qualifier1"); byte[] value1 = dataHelper.randomData("value1"); byte[] family2 = dataHelper.randomData("cf2"); byte[] qualifier2 = dataHelper.randomData("qualifier2"); byte[] value2 = dataHelper.randomData("value2"); mutations.add(new Put(rowKey).addColumn(family1, qualifier1, value1)); mutations.add(new Put(rowKey).addColumn(family2, qualifier2, value2)); com.google.cloud.bigtable.data.v2.models.Mutation mutation = com.google.cloud.bigtable.data.v2.models.Mutation.create(); adapter.adapt(mutations, mutation); MutateRowRequest result = toMutateRowRequest(rowKey, mutation); Assert.assertArrayEquals(rowKey, result.getRowKey().toByteArray()); Mockito.verify(mutationAdapter, times(2)) .adapt(any(org.apache.hadoop.hbase.client.Mutation.class), eq(mutation)); }