package com.predic8.membrane.starter.dsl;

import com.predic8.membrane.core.config.Path;
import com.predic8.membrane.core.rules.ServiceProxy;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;


@DisplayName("A MatcherSpecification")
public class MatcherSpecificationTests {
    private ServiceProxy serviceProxy;
    private MatcherSpecification matcherSpecification;

    @BeforeEach
    public void setUp() {
        serviceProxy = new ServiceProxy();
        matcherSpecification = new MatcherSpecification(serviceProxy);
    }

    @Test
    @DisplayName("should set the method on the service proxy")
    public void testSetMethod() {
        matcherSpecification.method("GET");

        assertThat(serviceProxy.getMethod()).isEqualTo("GET");
    }

    @Test
    @DisplayName("should set the path pathPrefix on the service proxy")
    public void testSetPathPrefix() {
        matcherSpecification.pathPrefix("/api/");

        assertThat(serviceProxy.getPath()).isEqualToComparingFieldByField(new Path(false, "/api/"));
    }

    @Test
    @DisplayName("should set the path pathRegex on the service proxy")
    public void testSetPathRegex() {
        matcherSpecification.pathRegex("^/api/.*$");

        assertThat(serviceProxy.getPath()).isEqualToComparingFieldByField(new Path(true, "^/api/.*$"));
    }
}
@@ -252,16 +252,60 @@
 pi.Test;
+%0Aimport org.springframework.http.HttpMethod;
 %0A%0Aimport
@@ -910,32 +910,291 @@
 (%22GET%22);%0A    %7D%0A%0A
+    @Test%0A    @DisplayName(%22should set the method on the service proxy using an enum value%22)%0A    public void testSetMethodTypeSafe() %7B%0A        matcherSpecification.method(HttpMethod.GET);%0A%0A        assertThat(serviceProxy.getMethod()).isEqualTo(%22GET%22);%0A    %7D%0A%0A
     @Test%0A    @D

Add method overload