Search in sources :

Example 1 with EdgeIdExtractor

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();
}
Also used : Entity(uk.gov.gchq.gaffer.data.element.Entity) EdgeIdExtractor(uk.gov.gchq.gaffer.operation.data.generator.EdgeIdExtractor) Test(org.junit.jupiter.api.Test)

Example 2 with EdgeIdExtractor

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());
}
Also used : EdgeIdExtractor(uk.gov.gchq.gaffer.operation.data.generator.EdgeIdExtractor) EdgeId(uk.gov.gchq.gaffer.data.element.id.EdgeId) Edge(uk.gov.gchq.gaffer.data.element.Edge) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)2 EdgeIdExtractor (uk.gov.gchq.gaffer.operation.data.generator.EdgeIdExtractor)2 Edge (uk.gov.gchq.gaffer.data.element.Edge)1 Entity (uk.gov.gchq.gaffer.data.element.Entity)1 EdgeId (uk.gov.gchq.gaffer.data.element.id.EdgeId)1