@Test
void shouldFilterFormUrlEncodedBodyIfValidRequest() {

    final BodyFilter unit = replaceFormUrlEncodedProperty(singleton("q"), "XXX");
    final String contentType = "application/x-www-form-urlencoded";
    assertThat(unit.filter(contentType, "q=boots&sort=price&direction=asc"), is("q=XXX&sort=price&direction=asc"));
    assertThat(unit.filter(contentType, "sort=price&direction=asc&q=boots"), is("sort=price&direction=asc&q=XXX"));
    assertThat(unit.filter(contentType, "sort=price&q=boots&direction=asc"), is("sort=price&q=XXX&direction=asc"));
    assertThat(unit.filter(contentType, "sort=price&direction=asc"), is("sort=price&direction=asc"));
    assertThat(unit.filter(contentType, "q=boots"), is("q=XXX"));
    assertThat(unit.filter(contentType, ""), is(""));
}