AccumuloEdgeValueLoader extends AccumuloElementValueLoader { @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST", justification = "element provided should always be an Edge") @Override public void loadIdentifiers(final Element edge) { final EdgeId edgeId = (EdgeId) elementConverter.getElementId(key, includeMatchedVertex); ((Edge) edge).setIdentifiers(edgeId.getSource(), edgeId.getDestination(), edgeId.isDirected(), edgeId.getMatchedVertex()); } AccumuloEdgeValueLoader(final String group,
                                   final Key key,
                                   final Value value,
                                   final AccumuloElementConverter elementConverter,
                                   final Schema schema,
                                   final boolean includeMatchedVertex); @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST", justification = "element provided should always be an Edge") @Override void loadIdentifiers(final Element edge);  }
@Test public void shouldLoadAllIdentifiers() throws SerialisationException { final String group = TestGroups.EDGE; final Key key = mock(Key.class); final Value value = mock(Value.class); final AccumuloElementConverter converter = mock(AccumuloElementConverter.class); final Schema schema = createSchema(); final AccumuloEdgeValueLoader loader = new AccumuloEdgeValueLoader(group, key, value, converter, schema, false); final Edge edge = mock(Edge.class); final EdgeId elementId = new EdgeSeed("source", "dest", true); given(converter.getElementId(key, false)).willReturn(elementId); loader.loadIdentifiers(edge); verify(edge).setIdentifiers("source", "dest", true, EdgeId.MatchedVertex.SOURCE); verify(converter, never()).getPropertiesFromColumnQualifier(Mockito.eq(group), Mockito.any(byte[].class)); verify(converter, never()).getPropertiesFromColumnVisibility(Mockito.eq(group), Mockito.any(byte[].class)); verify(converter, never()).getPropertiesFromTimestamp(Mockito.eq(group), Mockito.anyLong()); verify(converter, never()).getPropertiesFromValue(Mockito.eq(group), Mockito.any(Value.class)); }