AccumuloEventStorageBolt extends AccumuloBaseBolt { Mutation getEventMutation(LogRecord record) { String recId = AccumuloBoltUtils.getEventRecordId(record, uuidPrefix, splits); Mutation mutation = new Mutation(recId); ColumnVisibility vis = getColumnVisibility(record); populateMutation(mutation, "data", vis, record.getFields()); populateMutation(mutation, "metadata", vis, record.getMetadata()); return mutation; }  @Override void cleanup(); static final String EVENT_TABLE; static final String UUID_PREFIX; static final String UUID_PREFIX_DEFAULT; static final String VISIBILITY; static final String VISIBILITY_BY_FIELD; static final String SPLITS; static final int SPLITS_DEFAULT; }
@Test public void testGetEventMutation( @Injectable LogRecord record, @Mocked Mutation event, @Injectable String uuidPrefix, @Injectable String recId, @Injectable ColumnVisibility vis, @Injectable Map<String, String> map) throws Exception { bolt.uuidPrefix = uuidPrefix; bolt.splits = AccumuloEventStorageBolt.SPLITS_DEFAULT; new MockUp<AccumuloBoltUtils>() { @Mock String getEventRecordId(LogRecord record, String prefix, int splits) { return recId; } }; new Expectations(bolt) {{ new Mutation(recId); result = event; bolt.getColumnVisibility(record); result = vis; record.getFields(); result = map; bolt.populateMutation(event, "data", vis, map); record.getMetadata(); result = map; bolt.populateMutation(event, "metadata", vis, map); }}; assertThat(bolt.getEventMutation(record), is(event)); }