Source:
<code>public void serviceEndpointsCanBeOverridden() { this.contextRunner.withPropertyValues("azure.service.endpoints.global.aadKeyDiscoveryUri=https://test/", "azure.service.endpoints.global.aadSigninUri=https://test/", "azure.service.endpoints.global.aadGraphApiUri=https://test/", "azure.service.endpoints.global.aadKeyDiscoveryUri=https://test/", "azure.service.endpoints.global.aadMembershipRestUri=https://test/") .run(context -> { final Environment environment = context.getEnvironment(); assertThat(environment.getProperty("azure.service.endpoints.global.aadSigninUri")) .isEqualTo("https://test/"); assertThat(environment.getProperty("azure.service.endpoints.global.aadGraphApiUri")) .isEqualTo("https://test/"); assertThat(environment.getProperty("azure.service.endpoints.global.aadKeyDiscoveryUri")) .isEqualTo("https://test/"); assertThat(environment.getProperty("azure.service.endpoints.global.aadMembershipRestUri")) .isEqualTo("https://test/"); final ServiceEndpointsProperties serviceEndpointsProperties = context.getBean(ServiceEndpointsProperties.class); assertThat(serviceEndpointsProperties).isNotNull(); assertThat(serviceEndpointsProperties.getEndpoints()).isNotEmpty(); final Map<String, ServiceEndpoints> endpoints = serviceEndpointsProperties.getEndpoints(); <START> Assertions.assertThat(endpoints).hasSize(4); <END> assertThat(endpoints.get("cn")).isNotNull() .extracting(ServiceEndpoints::getAadGraphApiUri, ServiceEndpoints::getAadKeyDiscoveryUri, ServiceEndpoints::getAadMembershipRestUri, ServiceEndpoints::getAadSigninUri) .containsExactly("<LINK_1>", "<LINK_2>", "<LINK_0>", "<LINK_3>"); assertThat(endpoints.get("global")).isNotNull() .extracting(ServiceEndpoints::getAadGraphApiUri, ServiceEndpoints::getAadKeyDiscoveryUri, ServiceEndpoints::getAadMembershipRestUri, ServiceEndpoints::getAadSigninUri) .containsExactly("https://test/", "https://test/", "https://test/", "https://test/"); }); }</code><technical_language>Assertions.assertThat(endpoints).hasSize(4); > assertThat(endpoints.get("cn")).isNotNull() format</technical_language>

Target:
public void serviceEndpointsCanBeOverridden() { this.contextRunner.withPropertyValues("azure.service.endpoints.global.aadKeyDiscoveryUri=https://test/", "azure.service.endpoints.global.aadSigninUri=https://test/", "azure.service.endpoints.global.aadGraphApiUri=https://test/", "azure.service.endpoints.global.aadKeyDiscoveryUri=https://test/", "azure.service.endpoints.global.aadMembershipRestUri=https://test/") .run(context -> { final Environment environment = context.getEnvironment(); assertThat(environment.getProperty("azure.service.endpoints.global.aadSigninUri")) .isEqualTo("https://test/"); assertThat(environment.getProperty("azure.service.endpoints.global.aadGraphApiUri")) .isEqualTo("https://test/"); assertThat(environment.getProperty("azure.service.endpoints.global.aadKeyDiscoveryUri")) .isEqualTo("https://test/"); assertThat(environment.getProperty("azure.service.endpoints.global.aadMembershipRestUri")) .isEqualTo("https://test/"); final ServiceEndpointsProperties serviceEndpointsProperties = context.getBean(ServiceEndpointsProperties.class); assertThat(serviceEndpointsProperties).isNotNull(); assertThat(serviceEndpointsProperties.getEndpoints()).isNotEmpty(); final Map<String, ServiceEndpoints> endpoints = serviceEndpointsProperties.getEndpoints(); assertThat(endpoints).hasSize(4); assertThat(endpoints.get("cn")).isNotNull() .extracting(ServiceEndpoints::getAadGraphApiUri, ServiceEndpoints::getAadKeyDiscoveryUri, ServiceEndpoints::getAadMembershipRestUri, ServiceEndpoints::getAadSigninUri) .containsExactly("<LINK_1>", "<LINK_2>", "<LINK_0>", "<LINK_3>"); assertThat(endpoints.get("global")).isNotNull() .extracting(ServiceEndpoints::getAadGraphApiUri, ServiceEndpoints::getAadKeyDiscoveryUri, ServiceEndpoints::getAadMembershipRestUri, ServiceEndpoints::getAadSigninUri) .containsExactly("https://test/", "https://test/", "https://test/", "https://test/"); }); }