use of uk.gov.gchq.gaffer.operation.data.generator.EdgeIdExtractor in project Gaffer by gchq.
the class EdgeIdExtractorTest method shouldThrowIllegalArgumentExceptionForEntity.
@Test
public void shouldThrowIllegalArgumentExceptionForEntity() {
// Given
final EdgeIdExtractor extractor = new EdgeIdExtractor();
final Entity entity = new Entity(TestGroups.ENTITY, "identifier");
// When / Then
assertThatIllegalArgumentException().isThrownBy(() -> extractor._apply(entity)).extracting("message").isNotNull();
}
use of uk.gov.gchq.gaffer.operation.data.generator.EdgeIdExtractor in project Gaffer by gchq.
the class EdgeIdExtractorTest method shouldGetIdentifierFromEdge.
@Test
public void shouldGetIdentifierFromEdge() {
// Given
final EdgeIdExtractor extractor = new EdgeIdExtractor();
final Edge edge = new Edge.Builder().group(TestGroups.EDGE).source("source").dest("destination").directed(true).build();
// When
final EdgeId seed = extractor._apply(edge);
// Then
assertEquals("source", seed.getSource());
assertEquals("destination", seed.getDestination());
assertTrue(seed.isDirected());
}
Aggregations