Skip to content

Commit

Permalink
extract test and annotate with @PendingFeature
Browse files Browse the repository at this point in the history
  • Loading branch information
sdelamo committed Apr 5, 2022
1 parent 27e8cfd commit 3e72e9f
Showing 1 changed file with 12 additions and 3 deletions.
Expand Up @@ -14,6 +14,7 @@ import io.micronaut.http.filter.ServerFilterChain
import io.micronaut.runtime.server.EmbeddedServer
import org.reactivestreams.Publisher
import spock.lang.AutoCleanup
import spock.lang.PendingFeature
import spock.lang.Shared
import spock.lang.Specification

Expand All @@ -26,18 +27,26 @@ class FilterReplaceRequestSpec extends Specification {
@Shared
@AutoCleanup
HttpClient client = server.applicationContext.createBean(HttpClient, server.URI)

def 'test replaced http request is handled by next filter'() {
when:
HttpResponse<String> resp = client.toBlocking().exchange("/initial", String)
client.toBlocking().exchange("/initial", String)
Filter1 filter1 = server.applicationContext.getBean(Filter1)
Filter2 filter2 = server.applicationContext.getBean(Filter2)

then:
resp.body() == "initial"
filter1.filteredRequest.path == "/initial"
filter2.filteredRequest.path == "/filter1"
}

@PendingFeature
def 'last filter http request is used to match route'() {
when:
HttpResponse<String> resp = client.toBlocking().retrieve("/initial", String)

then:
resp.body() == "filter2"
}

@Filter(Filter.MATCH_ALL_PATTERN)
@Requires(property = 'spec.name', value = 'FilterReplaceRequestSpec')
Expand Down

0 comments on commit 3e72e9f

Please sign in to comment.