Search in sources :

Example 1 with EdgeSeedExtractor

use of uk.gov.gchq.gaffer.operation.data.generator.EdgeSeedExtractor in project Gaffer by gchq.

the class EdgeSeedExtractorTest method shouldThrowIllegalArgumentExceptionForEntity.

@Test
public void shouldThrowIllegalArgumentExceptionForEntity() {
    // Given
    final EdgeSeedExtractor extractor = new EdgeSeedExtractor();
    final Entity entity = new Entity(TestGroups.ENTITY, "identifier");
    // When / Then
    try {
        extractor.getObject(entity);
        fail("Exception expected");
    } catch (final IllegalArgumentException e) {
        assertNotNull(e);
    }
}
Also used : EdgeSeedExtractor(uk.gov.gchq.gaffer.operation.data.generator.EdgeSeedExtractor) Entity(uk.gov.gchq.gaffer.data.element.Entity) Test(org.junit.Test)

Example 2 with EdgeSeedExtractor

use of uk.gov.gchq.gaffer.operation.data.generator.EdgeSeedExtractor in project Gaffer by gchq.

the class EdgeSeedExtractorTest method shouldGetIdentifierFromEdge.

@Test
public void shouldGetIdentifierFromEdge() {
    // Given
    final EdgeSeedExtractor extractor = new EdgeSeedExtractor();
    final Edge edge = new Edge(TestGroups.EDGE, "source", "destination", true);
    // When
    final EdgeSeed seed = extractor.getObject(edge);
    // Then
    assertEquals("source", seed.getSource());
    assertEquals("destination", seed.getDestination());
    assertTrue(seed.isDirected());
}
Also used : EdgeSeedExtractor(uk.gov.gchq.gaffer.operation.data.generator.EdgeSeedExtractor) EdgeSeed(uk.gov.gchq.gaffer.operation.data.EdgeSeed) Edge(uk.gov.gchq.gaffer.data.element.Edge) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 EdgeSeedExtractor (uk.gov.gchq.gaffer.operation.data.generator.EdgeSeedExtractor)2 Edge (uk.gov.gchq.gaffer.data.element.Edge)1 Entity (uk.gov.gchq.gaffer.data.element.Entity)1 EdgeSeed (uk.gov.gchq.gaffer.operation.data.EdgeSeed)1