Last active
October 5, 2023 13:39
How to Use JUnit ErrorCollector [With Examples]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.lambdatest.junit; | |
import org.junit.Rule; | |
import org.junit.Test; | |
import org.junit.rules.ErrorCollector; | |
public class ErrorCollectorTestAdd { | |
@Rule | |
public final ErrorCollector collector = new ErrorCollector(); | |
@Test | |
public void testWithErrorCollector() { | |
collector.addError(new Throwable("error 1")); | |
collector.addError(new Throwable("error 2")); | |
collector.addError(new Throwable("error 3")); | |
collector.addError(new Throwable("error 4")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment