|
|
|
@ -261,14 +261,13 @@ public class OpenSaml4AssertingPartyMetadataRepositoryTests { |
|
|
|
TestOpenSamlObjects.signed(descriptor, TestSaml2X509Credentials.assertingPartySigningCredential(), |
|
|
|
TestOpenSamlObjects.signed(descriptor, TestSaml2X509Credentials.assertingPartySigningCredential(), |
|
|
|
descriptor.getEntityID()); |
|
|
|
descriptor.getEntityID()); |
|
|
|
String serialized = serialize(descriptor); |
|
|
|
String serialized = serialize(descriptor); |
|
|
|
try (MockWebServer server = new MockWebServer()) { |
|
|
|
String endpoint = "/" + UUID.randomUUID().toString(); |
|
|
|
enqueue(server, serialized, 3); |
|
|
|
dispatcher.addResponse(endpoint, serialized); |
|
|
|
AssertingPartyMetadataRepository parties = OpenSaml4AssertingPartyMetadataRepository |
|
|
|
AssertingPartyMetadataRepository parties = OpenSaml4AssertingPartyMetadataRepository |
|
|
|
.withTrustedMetadataLocation(server.url("/").toString()) |
|
|
|
.withTrustedMetadataLocation(web.url(endpoint).toString()) |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
assertThat(parties.findByEntityId(registration.getAssertingPartyDetails().getEntityId())).isNotNull(); |
|
|
|
assertThat(parties.findByEntityId(registration.getAssertingPartyDetails().getEntityId())).isNotNull(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void withTrustedMetadataLocationWhenCustomResourceLoaderThenUses() { |
|
|
|
public void withTrustedMetadataLocationWhenCustomResourceLoaderThenUses() { |
|
|
|
@ -362,12 +361,6 @@ public class OpenSaml4AssertingPartyMetadataRepositoryTests { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void enqueue(MockWebServer web, String body, int times) { |
|
|
|
|
|
|
|
for (int i = 0; i < times; i++) { |
|
|
|
|
|
|
|
web.enqueue(new MockResponse().setBody(body).setResponseCode(200)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final class MetadataDispatcher extends Dispatcher { |
|
|
|
private static final class MetadataDispatcher extends Dispatcher { |
|
|
|
|
|
|
|
|
|
|
|
private final MockResponse head = new MockResponse(); |
|
|
|
private final MockResponse head = new MockResponse(); |
|
|
|
|