Commit a8f68153 authored by Miguel Reboiro Jato's avatar Miguel Reboiro Jato

Fixes port already used in welcome test

The use of RepeatedTest in the welcome test caused failures in some
computers due to an insufficient time to close the port.

This commit fixes this error by using a for to repeat the test,
avoiding the creation of a new server in each repetition.
parent 1121f6aa
......@@ -23,14 +23,16 @@ import static org.hamcrest.MatcherAssert.assertThat;
import java.io.IOException;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Test;
import es.uvigo.esei.dai.hybridserver.utils.HybridServerTestCase;
public class WelcomePageTest extends HybridServerTestCase {
@RepeatedTest(10)
@Test
public void testWelcome() throws IOException {
assertThat(getContentWithType(url, "text/html"), containsString("Hybrid Server"));
for (int i = 0; i < 10; i++) {
assertThat(getContentWithType(url, "text/html"), containsString("Hybrid Server"));
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment