Skip to content

Commit

Permalink
reverted test
Browse files Browse the repository at this point in the history
  • Loading branch information
strehle committed Nov 14, 2024
1 parent 78a21cd commit a718479
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,19 @@ void findByRegistrationIdWhenNoneFound() {
}

@Test
void getsNullOnNoExactMatch() {
void getsDefaultOnNoExactMatch() {
String metadata = loadResouceAsString("saml-sample-metadata.xml");
when(repository.retrieveZone()).thenReturn(identityZone);
when(identityZone.isUaa()).thenReturn(true);
when(identityZone.getConfig()).thenReturn(identityZoneConfiguration);
when(identityZoneConfiguration.getSamlConfig()).thenReturn(samlConfig);
when(definition.getIdpEntityAlias()).thenReturn(REGISTRATION_ID);
when(definition.getNameID()).thenReturn(NAME_ID);
when(definition.getMetaDataLocation()).thenReturn(metadata);
when(configurator.getIdentityProviderDefinitionsForZone(identityZone)).thenReturn(List.of(definition));
assertThat(repository.findByRegistrationId("defaultRegistrationId")).isNull();

assertThat(repository.findByRegistrationId("defaultRegistrationId"))
.returns(REGISTRATION_ID, RelyingPartyRegistration::getRegistrationId);
}

@Test
Expand Down

0 comments on commit a718479

Please sign in to comment.