Код: Выделить всё
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class TestTest {
String expectedString;
@BeforeEach
public void setUp() {
expectedString = "woof";
}
@Test
public void testBark() {
assertEquals(expectedString, "woof");
}
@Test
public void bark(){
assertEquals(expectedString, "woof");
}
}
Код: Выделить всё
Running TestTest
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.012 sec
Подробнее здесь: [url]https://stackoverflow.com/questions/78664620/maven-test-fails-when-run-through-github-actions-but-not-when-run-locally[/url]
Мобильная версия