Test case to reject a null consumer
package io.smallrye.mutiny.infrastructure;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -23,6 +24,13 @@ public class DroppedExceptionsTest {
Infrastructure.resetDroppedExceptionHandler();
}
+ @Test
+ public void rejectNullConsumer() {
+ assertThatThrownBy(() -> Infrastructure.setDroppedExceptionHandler(null))
+ .isInstanceOf(IllegalArgumentException.class)
+ .hasMessageContaining("handler");
+ }
+
@Test
public void testDefaultHandler() {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
