KEYCLOAK-17734 LifespanAdapterTest fails due to header check
This commit is contained in:
parent
b4c85c83e6
commit
c2c1b482ea
1 changed files with 10 additions and 1 deletions
|
@ -23,6 +23,7 @@ import java.io.File;
|
|||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.hamcrest.Matchers;
|
||||
|
@ -155,7 +156,15 @@ public class LifespanAdapterTest extends AbstractPhotozExampleAdapterTest {
|
|||
clientPage.viewProfile((ResponseValidator) response -> {
|
||||
Object headers = response.get("responseHeaders");
|
||||
assertThat(headers, Matchers.notNullValue());
|
||||
assertThat(headers.toString(), Matchers.containsString("WWW-Authenticate: UMA"));
|
||||
|
||||
List<String> headersList = Arrays.asList(headers.toString().split("\r\n"));
|
||||
String wwwAuthenticate = headersList.stream()
|
||||
.filter(s -> s.toLowerCase().startsWith("www-authenticate:"))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
assertThat(wwwAuthenticate, Matchers.notNullValue());
|
||||
assertThat(wwwAuthenticate, Matchers.containsString("UMA"));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue