use of uk.gov.gchq.gaffer.data.element.id.EntityId in project Gaffer by gchq.
the class FromEntityIdTest method shouldReturnNullIfTheInputIsNull.
@Test
public void shouldReturnNullIfTheInputIsNull() {
// Given
final EntityId input = null;
final FromEntityId function = new FromEntityId();
// When
final Object output = function.apply(input);
// Then
assertNull(output);
}
use of uk.gov.gchq.gaffer.data.element.id.EntityId in project Gaffer by gchq.
the class ToEntityIdTest method shouldReturnNullIfTheInputIsNull.
@Test
public void shouldReturnNullIfTheInputIsNull() {
// Given
final Object input = null;
final ToEntityId function = new ToEntityId();
// When
final EntityId output = function.apply(input);
// Then
assertNull(output);
}
use of uk.gov.gchq.gaffer.data.element.id.EntityId in project Gaffer by gchq.
the class ToEntityIdTest method shouldReturnOriginalValueIfInputIsAnEntity.
@Test
public void shouldReturnOriginalValueIfInputIsAnEntity() {
// Given
final Entity input = new Entity("group", "item");
final ToEntityId function = new ToEntityId();
// When
final EntityId output = function.apply(input);
// Then
assertSame(input, output);
}
use of uk.gov.gchq.gaffer.data.element.id.EntityId in project Gaffer by gchq.
the class ToEntityIdTest method shouldReturnOriginalValueIfInputIsAnEntitySeed.
@Test
public void shouldReturnOriginalValueIfInputIsAnEntitySeed() {
// Given
final EntitySeed input = new EntitySeed("item");
final ToEntityId function = new ToEntityId();
// When
final EntityId output = function.apply(input);
// Then
assertSame(input, output);
}
use of uk.gov.gchq.gaffer.data.element.id.EntityId in project Gaffer by gchq.
the class EntitySeedTest method shouldBeRelatedToEdgeIdWhenSourceAndVertexAreNull.
@Test
public void shouldBeRelatedToEdgeIdWhenSourceAndVertexAreNull() {
// Given
final String source = null;
final String destination = "destination";
final EntityId seed = new EntitySeed(destination);
final EdgeId relatedSeed = mock(EdgeId.class);
given(relatedSeed.getSource()).willReturn(source);
given(relatedSeed.getDestination()).willReturn(destination);
// Then
assertTrue(seed.isRelated((ElementId) relatedSeed).isMatch());
}
Aggregations