use of io.confluent.ksql.query.QueryError.Type in project ksql by confluentinc.
the class RegexClassifierTest method shouldClassifyAsUnknown.
@Test
public void shouldClassifyAsUnknown() {
// Given:
final QueryErrorClassifier classifier = RegexClassifier.fromConfig("USER .*foo.*", "id");
when(error.getCause()).thenReturn(cause);
givenMessage(error, "bar");
givenMessage(cause, "baz");
// When:
final Type type = classifier.classify(error);
// Then:
assertThat(type, is(Type.UNKNOWN));
}
use of io.confluent.ksql.query.QueryError.Type in project ksql by confluentinc.
the class RegexClassifierTest method shouldClassifyNPEAsUnknwon.
@Test
public void shouldClassifyNPEAsUnknwon() {
// Given:
final QueryErrorClassifier classifier = RegexClassifier.fromConfig("USER .*foo.*", "id");
// When:
final Type type = classifier.classify(npe());
// Then:
assertThat(type, is(Type.UNKNOWN));
}
use of io.confluent.ksql.query.QueryError.Type in project ksql by confluentinc.
the class QueryErrorClassifierTest method shouldChainIdentical.
@Test
public void shouldChainIdentical() {
// Given:
when(classifierA.classify(any())).thenReturn(Type.USER);
when(classifierB.classify(any())).thenReturn(Type.USER);
// When:
final Type type = classifierA.and(classifierB).classify(error);
// Then:
assertThat(type, is(Type.USER));
}
use of io.confluent.ksql.query.QueryError.Type in project ksql by confluentinc.
the class QueryErrorClassifierTest method shouldChainUnknownUnknown.
@Test
public void shouldChainUnknownUnknown() {
// Given:
when(classifierA.classify(any())).thenReturn(Type.UNKNOWN);
when(classifierB.classify(any())).thenReturn(Type.UNKNOWN);
// When:
final Type type = classifierA.and(classifierB).classify(error);
// Then:
assertThat(type, is(Type.UNKNOWN));
}
use of io.confluent.ksql.query.QueryError.Type in project ksql by confluentinc.
the class QueryErrorClassifierTest method shouldChainUnknownSomething.
@Test
public void shouldChainUnknownSomething() {
// Given:
when(classifierA.classify(any())).thenReturn(Type.UNKNOWN);
when(classifierB.classify(any())).thenReturn(Type.USER);
// When:
final Type type = classifierA.and(classifierB).classify(error);
// Then:
assertThat(type, is(Type.USER));
}
Aggregations