|
11 | 11 | import org.mockito.MockedStatic; |
12 | 12 | import org.mockito.junit.jupiter.MockitoExtension; |
13 | 13 | import static org.junit.jupiter.api.Assertions.assertEquals; |
14 | | -import static org.junit.jupiter.api.Assertions.assertNotNull; |
15 | 14 | import static org.junit.jupiter.api.Assertions.assertThrows; |
16 | 15 | import static org.junit.jupiter.api.Assertions.assertTrue; |
17 | 16 | import static org.mockito.Mockito.CALLS_REAL_METHODS; |
18 | 17 | import static org.mockito.Mockito.mockStatic; |
19 | 18 |
|
20 | | -import java.lang.reflect.Method; |
21 | 19 | import java.net.URI; |
22 | 20 | import java.net.URL; |
23 | 21 |
|
@@ -139,34 +137,6 @@ void aadInstanceDiscoveryTest_AutoDetectRegion_NoRegionDetected() throws Excepti |
139 | 137 | } |
140 | 138 | } |
141 | 139 |
|
142 | | - @Test |
143 | | - void discoveryEndpoint_routesToSovereignHost() throws Exception { |
144 | | - // Arrange |
145 | | - URL sovereignUrl = new URL("https://login.sovcloud-identity.fr/my_tenant"); |
146 | | - Method method = AadInstanceDiscoveryProvider.class.getDeclaredMethod("getInstanceDiscoveryEndpoint", URL.class); |
147 | | - method.setAccessible(true); |
148 | | - |
149 | | - // Act |
150 | | - String endpoint = (String) method.invoke(null, sovereignUrl); |
151 | | - |
152 | | - // Assert |
153 | | - assertTrue(endpoint.contains("login.sovcloud-identity.fr"), |
154 | | - "Discovery endpoint should use the sovereign host, got: " + endpoint); |
155 | | - } |
156 | | - |
157 | | - @Test |
158 | | - void regionalEndpoint_usesSovereignTemplate() throws Exception { |
159 | | - // Arrange |
160 | | - Method method = AadInstanceDiscoveryProvider.class.getDeclaredMethod("getRegionalizedHost", String.class, String.class); |
161 | | - method.setAccessible(true); |
162 | | - |
163 | | - // Act |
164 | | - String result = (String) method.invoke(null, "login.sovcloud-identity.fr", "westeurope"); |
165 | | - |
166 | | - // Assert |
167 | | - assertEquals("westeurope.login.sovcloud-identity.fr", result); |
168 | | - } |
169 | | - |
170 | 140 | void assertValidResponse(InstanceDiscoveryMetadataEntry entry) { |
171 | 141 | assertEquals(entry.preferredNetwork(), "login.microsoftonline.com"); |
172 | 142 | assertEquals(entry.preferredCache(), "login.windows.net"); |
|
0 commit comments