Search in sources :

Example 1 with NotSerializableExceptionWrapper

use of org.opensearch.common.io.stream.NotSerializableExceptionWrapper in project anomaly-detection by opensearch-project.

the class NotSerializedADExceptionNameTests method testConvertClientException.

public void testConvertClientException() {
    Optional<AnomalyDetectionException> converted = NotSerializedADExceptionName.convertWrappedAnomalyDetectionException(new NotSerializableExceptionWrapper(new ClientException("", "")), "");
    assertTrue(converted.isPresent());
    assertTrue(converted.get() instanceof ClientException);
}
Also used : NotSerializableExceptionWrapper(org.opensearch.common.io.stream.NotSerializableExceptionWrapper)

Example 2 with NotSerializableExceptionWrapper

use of org.opensearch.common.io.stream.NotSerializableExceptionWrapper in project anomaly-detection by opensearch-project.

the class NotSerializedADExceptionNameTests method testUnknownException.

public void testUnknownException() {
    Optional<AnomalyDetectionException> converted = NotSerializedADExceptionName.convertWrappedAnomalyDetectionException(new NotSerializableExceptionWrapper(new RuntimeException("")), "");
    assertTrue(!converted.isPresent());
}
Also used : NotSerializableExceptionWrapper(org.opensearch.common.io.stream.NotSerializableExceptionWrapper)

Example 3 with NotSerializableExceptionWrapper

use of org.opensearch.common.io.stream.NotSerializableExceptionWrapper in project anomaly-detection by opensearch-project.

the class NotSerializedADExceptionNameTests method testConvertADValidationException.

public void testConvertADValidationException() {
    Optional<AnomalyDetectionException> converted = NotSerializedADExceptionName.convertWrappedAnomalyDetectionException(new NotSerializableExceptionWrapper(new ADValidationException("", null, null)), "");
    assertTrue(converted.isPresent());
    assertTrue(converted.get() instanceof ADValidationException);
}
Also used : NotSerializableExceptionWrapper(org.opensearch.common.io.stream.NotSerializableExceptionWrapper)

Example 4 with NotSerializableExceptionWrapper

use of org.opensearch.common.io.stream.NotSerializableExceptionWrapper in project anomaly-detection by opensearch-project.

the class NotSerializedADExceptionNameTests method testConvertDuplicateTaskException.

public void testConvertDuplicateTaskException() {
    Optional<AnomalyDetectionException> converted = NotSerializedADExceptionName.convertWrappedAnomalyDetectionException(new NotSerializableExceptionWrapper(new DuplicateTaskException("")), "");
    assertTrue(converted.isPresent());
    assertTrue(converted.get() instanceof DuplicateTaskException);
}
Also used : NotSerializableExceptionWrapper(org.opensearch.common.io.stream.NotSerializableExceptionWrapper)

Example 5 with NotSerializableExceptionWrapper

use of org.opensearch.common.io.stream.NotSerializableExceptionWrapper in project anomaly-detection by opensearch-project.

the class NotSerializedADExceptionNameTests method testConvertAnomalyDetectionException.

public void testConvertAnomalyDetectionException() {
    Optional<AnomalyDetectionException> converted = NotSerializedADExceptionName.convertWrappedAnomalyDetectionException(new NotSerializableExceptionWrapper(new AnomalyDetectionException("", "")), "");
    assertTrue(converted.isPresent());
    assertTrue(converted.get() instanceof AnomalyDetectionException);
}
Also used : NotSerializableExceptionWrapper(org.opensearch.common.io.stream.NotSerializableExceptionWrapper)

Aggregations

NotSerializableExceptionWrapper (org.opensearch.common.io.stream.NotSerializableExceptionWrapper)14 IOException (java.io.IOException)6 ActionListener (org.opensearch.action.ActionListener)6 HashMap (java.util.HashMap)4 Iterator (java.util.Iterator)4 Map (java.util.Map)4 Consumer (java.util.function.Consumer)4 LogManager (org.apache.logging.log4j.LogManager)4 Logger (org.apache.logging.log4j.Logger)4 ParameterizedMessage (org.apache.logging.log4j.message.ParameterizedMessage)4 ExceptionsHelper (org.opensearch.ExceptionsHelper)4 OpenSearchSecurityException (org.opensearch.OpenSearchSecurityException)4 ResourceAlreadyExistsException (org.opensearch.ResourceAlreadyExistsException)4 ResourceNotFoundException (org.opensearch.ResourceNotFoundException)4 DocWriteResponse (org.opensearch.action.DocWriteResponse)4 BackoffPolicy (org.opensearch.action.bulk.BackoffPolicy)4 DeleteRequest (org.opensearch.action.delete.DeleteRequest)4 GetRequest (org.opensearch.action.get.GetRequest)4 IndexRequestBuilder (org.opensearch.action.index.IndexRequestBuilder)3 IndexResponse (org.opensearch.action.index.IndexResponse)3