use of org.apache.spark.scheduler.JobFailed in project OpenLineage by OpenLineage.
the class ErrorFacetBuilderTest method testBuildErrorFacet.
@Test
public void testBuildErrorFacet() {
JobFailed failure = new JobFailed(new TestException("The test exception message"));
SparkListenerJobEnd event = new SparkListenerJobEnd(1, 1L, failure);
ErrorFacetBuilder builder = new ErrorFacetBuilder();
assertThat(builder.isDefinedAt(event)).isTrue();
Map<String, RunFacet> runFacetMap = new HashMap<>();
builder.build(event, runFacetMap::put);
assertThat(runFacetMap).hasEntrySatisfying("spark.exception", facet -> assertThat(facet).isInstanceOf(ErrorFacet.class).extracting("message").isEqualTo(failure.exception().getMessage()));
}
Aggregations