MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby. MockServer also includes a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding).
Describe the issue
When @MockServerSettings is placed over abstract parent class, it is not picked up.
What you are trying to do
We have a bunch of tests with common setup logic that is extracted to base parent test class and would like to reuse @MockServerSettings configuration for all of them.
MockServer version
5.10
To Reproduce
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockserver.junit.jupiter.MockServerExtension;
import org.mockserver.junit.jupiter.MockServerSettings;
@MockServerSettings(ports = 6767)
@ExtendWith(MockServerExtension.class)
public abstract class BaseTest {
}
import org.junit.jupiter.api.Test;
import org.mockserver.client.MockServerClient;
import org.mockserver.model.HttpRequest;
import org.mockserver.model.HttpResponse;
public class Test1 extends BaseTest {
private final MockServerClient client;
public Test1(MockServerClient client) {
this.client = client;
}
@Test
void my_test() {
client.when(HttpRequest.request().withPath("/any"))
.respond(HttpResponse.response().withStatusCode(200));
}
}
Expected behaviour@MockServerSettings is picked up from parent class.
MockServer Log
2020-05-14 14:42:21 INFO MockServerEventLog:105 - started on port: 61862
Describe the issue When
@MockServerSettings
is placed over abstract parent class, it is not picked up.What you are trying to do We have a bunch of tests with common setup logic that is extracted to base parent test class and would like to reuse
@MockServerSettings
configuration for all of them.MockServer version 5.10
To Reproduce
Expected behaviour
@MockServerSettings
is picked up from parent class.MockServer Log