@@ -43,8 +43,8 @@ TEST_F(ServiceEndpointsConfigFileLoaderTest, TestServiceSpecificEndpoints)
4343 ASSERT_NE (profiles.end (), profileIt);
4444 const auto & profile = profileIt->second ;
4545 auto globalEndpoint = profile.GetGlobalEndpointUrl ();
46- ASSERT_TRUE (globalEndpoint.has_value ());
47- ASSERT_STREQ (" https://global.example.com" , globalEndpoint-> c_str ());
46+ ASSERT_FALSE (globalEndpoint.empty ());
47+ ASSERT_STREQ (" https://global.example.com" , globalEndpoint. c_str ());
4848
4949 // Test services endpoints are parsed correctly
5050 const auto & services = profile.GetServices ();
@@ -76,7 +76,7 @@ TEST_F(ServiceEndpointsConfigFileLoaderTest, TestServiceSpecificEndpointsOnly)
7676
7777 // Test that global endpoint is null when not set
7878 auto globalEndpoint = profile.GetGlobalEndpointUrl ();
79- ASSERT_FALSE (globalEndpoint.has_value ());
79+ ASSERT_TRUE (globalEndpoint.empty ());
8080
8181 // Test services endpoints are parsed correctly
8282 const auto & services = profile.GetServices ();
@@ -104,8 +104,8 @@ TEST_F(ServiceEndpointsConfigFileLoaderTest, TestGlobalEndpointOnly)
104104
105105 // Test global endpoint
106106 auto globalEndpoint = profile.GetGlobalEndpointUrl ();
107- ASSERT_TRUE (globalEndpoint.has_value ());
108- ASSERT_STREQ (" https://play.min.io:9000" , globalEndpoint-> c_str ());
107+ ASSERT_FALSE (globalEndpoint.empty ());
108+ ASSERT_STREQ (" https://play.min.io:9000" , globalEndpoint. c_str ());
109109
110110 // Test that services endpoints are not set
111111 const auto & services = profile.GetServices ();
@@ -141,8 +141,8 @@ TEST_F(ServiceEndpointsConfigFileLoaderTest, TestServiceSpecificAndGlobalEndpoin
141141
142142 // Test global endpoint
143143 auto globalEndpoint = profile.GetGlobalEndpointUrl ();
144- ASSERT_TRUE (globalEndpoint.has_value ());
145- ASSERT_STREQ (" http://localhost:1234" , globalEndpoint-> c_str ());
144+ ASSERT_FALSE (globalEndpoint.empty ());
145+ ASSERT_STREQ (" http://localhost:1234" , globalEndpoint. c_str ());
146146}
147147
148148TEST_F (ServiceEndpointsConfigFileLoaderTest, TestMultipleServicesInDefinition)
@@ -195,7 +195,7 @@ TEST_F(ServiceEndpointsConfigFileLoaderTest, TestIgnoreGlobalEndpointInServicesS
195195
196196 // Test that global endpoint in services section is ignored
197197 auto globalEndpoint = profile.GetGlobalEndpointUrl ();
198- ASSERT_FALSE (globalEndpoint.has_value ());
198+ ASSERT_TRUE (globalEndpoint.empty ());
199199
200200 // Test that services endpoints are empty (global endpoint_url ignored)
201201 const auto & services = profile.GetServices ();
@@ -240,12 +240,12 @@ TEST_F(ServiceEndpointsConfigFileLoaderTest, TestSourceProfileEndpointIsolation)
240240
241241 // Test that profile B has no global endpoint (doesn't inherit from profile A)
242242 auto globalEndpointB = profileB.GetGlobalEndpointUrl ();
243- ASSERT_FALSE (globalEndpointB.has_value ());
243+ ASSERT_TRUE (globalEndpointB.empty ());
244244
245245 // Test that profile A still has its own global endpoint
246246 auto globalEndpointA = profileA.GetGlobalEndpointUrl ();
247- ASSERT_TRUE (globalEndpointA.has_value ());
248- ASSERT_STREQ (" https://profile-a-endpoint.aws/" , globalEndpointA-> c_str ());
247+ ASSERT_FALSE (globalEndpointA.empty ());
248+ ASSERT_STREQ (" https://profile-a-endpoint.aws/" , globalEndpointA. c_str ());
249249
250250 // Test that profile A has no services name
251251 const auto & servicesA = profileA.GetServices ();
@@ -325,8 +325,8 @@ TEST_F(ServiceEndpointsConfigFileLoaderTest, TestDuplicateGlobalEndpointUrl)
325325
326326 // Test that last value wins for duplicate global endpoint_url
327327 auto globalEndpoint = profile.GetGlobalEndpointUrl ();
328- ASSERT_TRUE (globalEndpoint.has_value ());
329- ASSERT_STREQ (" https://play2.min.io:9000" , globalEndpoint-> c_str ());
328+ ASSERT_FALSE (globalEndpoint.empty ());
329+ ASSERT_STREQ (" https://play2.min.io:9000" , globalEndpoint. c_str ());
330330}
331331
332332TEST_F (ServiceEndpointsConfigFileLoaderTest, TestDuplicateServiceEndpointUrl)
@@ -385,8 +385,8 @@ TEST_F(ServiceEndpointsConfigFileLoaderTest, TestMixedDuplicateEndpoints)
385385
386386 // Test that last global endpoint_url wins
387387 auto globalEndpoint = profile.GetGlobalEndpointUrl ();
388- ASSERT_TRUE (globalEndpoint.has_value ());
389- ASSERT_STREQ (" https://global2.example.com" , globalEndpoint-> c_str ());
388+ ASSERT_FALSE (globalEndpoint.empty ());
389+ ASSERT_STREQ (" https://global2.example.com" , globalEndpoint. c_str ());
390390
391391 // Test that last service endpoint_url wins, but other services remain
392392 const auto & services = profile.GetServices ();
0 commit comments