use of uk.gov.gchq.gaffer.function.ConsumerFunction in project Gaffer by gchq.
the class ConsumerFunctionContextTest method shouldThrowExceptionWhenBuildContextWhenExecuteCalledTwice.
@Test
public void shouldThrowExceptionWhenBuildContextWhenExecuteCalledTwice() {
// Given
final String reference1 = "reference 1";
final ConsumerFunction func1 = mock(ConsumerFunction.class);
final ConsumerFunction func2 = mock(ConsumerFunction.class);
// When / Then
try {
new ConsumerFunctionContext.Builder<String, ConsumerFunction>().select(reference1).execute(func1).execute(func2).build();
fail("Exception expected");
} catch (final IllegalStateException e) {
assertNotNull(e);
}
}
use of uk.gov.gchq.gaffer.function.ConsumerFunction in project Gaffer by gchq.
the class ConsumerFunctionContextTest method shouldThrowExceptionWhenBuildContextWhenSelectCalledTwice.
@Test
public void shouldThrowExceptionWhenBuildContextWhenSelectCalledTwice() {
// Given
final String reference1 = "reference 1";
final String reference2 = "reference 2";
final ConsumerFunction func1 = mock(ConsumerFunction.class);
// When / Then
try {
new ConsumerFunctionContext.Builder<String, ConsumerFunction>().select(reference1).execute(func1).select(reference2).build();
fail("Exception expected");
} catch (final IllegalStateException e) {
assertNotNull(e);
}
}
Aggregations