Apply OpenSAML Test Fix to Remaining Test
There was one test that wasn't converted and now it is. Issue gh-15395
This commit is contained in:
parent
626610a975
commit
c9d083717f
|
@ -261,13 +261,12 @@ public class OpenSaml4AssertingPartyMetadataRepositoryTests {
|
|||
TestOpenSamlObjects.signed(descriptor, TestSaml2X509Credentials.assertingPartySigningCredential(),
|
||||
descriptor.getEntityID());
|
||||
String serialized = serialize(descriptor);
|
||||
try (MockWebServer server = new MockWebServer()) {
|
||||
enqueue(server, serialized, 3);
|
||||
AssertingPartyMetadataRepository parties = OpenSaml4AssertingPartyMetadataRepository
|
||||
.withTrustedMetadataLocation(server.url("/").toString())
|
||||
.build();
|
||||
assertThat(parties.findByEntityId(registration.getAssertingPartyDetails().getEntityId())).isNotNull();
|
||||
}
|
||||
String endpoint = "/" + UUID.randomUUID().toString();
|
||||
dispatcher.addResponse(endpoint, serialized);
|
||||
AssertingPartyMetadataRepository parties = OpenSaml4AssertingPartyMetadataRepository
|
||||
.withTrustedMetadataLocation(web.url(endpoint).toString())
|
||||
.build();
|
||||
assertThat(parties.findByEntityId(registration.getAssertingPartyDetails().getEntityId())).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -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 final MockResponse head = new MockResponse();
|
||||
|
|
|
@ -261,13 +261,12 @@ public class OpenSaml5AssertingPartyMetadataRepositoryTests {
|
|||
TestOpenSamlObjects.signed(descriptor, TestSaml2X509Credentials.assertingPartySigningCredential(),
|
||||
descriptor.getEntityID());
|
||||
String serialized = serialize(descriptor);
|
||||
try (MockWebServer server = new MockWebServer()) {
|
||||
enqueue(server, serialized, 3);
|
||||
AssertingPartyMetadataRepository parties = OpenSaml5AssertingPartyMetadataRepository
|
||||
.withTrustedMetadataLocation(server.url("/").toString())
|
||||
.build();
|
||||
assertThat(parties.findByEntityId(registration.getAssertingPartyDetails().getEntityId())).isNotNull();
|
||||
}
|
||||
String endpoint = "/" + UUID.randomUUID().toString();
|
||||
dispatcher.addResponse(endpoint, serialized);
|
||||
AssertingPartyMetadataRepository parties = OpenSaml5AssertingPartyMetadataRepository
|
||||
.withTrustedMetadataLocation(web.url(endpoint).toString())
|
||||
.build();
|
||||
assertThat(parties.findByEntityId(registration.getAssertingPartyDetails().getEntityId())).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -362,12 +361,6 @@ public class OpenSaml5AssertingPartyMetadataRepositoryTests {
|
|||
}
|
||||
}
|
||||
|
||||
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 final MockResponse head = new MockResponse();
|
||||
|
|
Loading…
Reference in New Issue