@@ -546,52 +546,7 @@ public void testCmabServiceConfigurationValidation() throws Exception {
546546
547547 assertNotNull ("Manager should be created successfully" , manager );
548548 }
549- //
550- // @Test
551- // public void testCmabServiceConfigurationValidation_2() throws Exception {
552- // // Custom configuration for cmab endpoint
553- // String customCmabEndpoint = "https://google.com";
554- //
555- // // Mock the builder and its static method
556- //
557- // DefaultCmabService.Builder mockBuilder = getMockDefaultCmabServiceBuilder();
558- // mockStatic(DefaultCmabService.class);
559- // when(DefaultCmabService.builder()).thenReturn(mockBuilder);
560- // DefaultCmabService mockDefaultCmabService = mock(DefaultCmabService.class);
561- // when(mockBuilder.build()).thenReturn(mockDefaultCmabService);
562- //
563- // // Prevent the real OptimizelyManager from being constructed
564- // whenNew(OptimizelyManager.class).withAnyArguments().thenReturn(mock(OptimizelyManager.class));
565- //
566- // // Spy on the real DefaultCmabClient constructor.
567- //
568- // final DefaultCmabClient[] clientSpyContainer = new DefaultCmabClient[1];
569- // whenNew(DefaultCmabClient.class).withAnyArguments().thenAnswer(invocation -> {
570- // // Create a REAL spy of the object that was about to be created.
571- // DefaultCmabClient realClient = (DefaultCmabClient) invocation.callRealMethod();
572- // DefaultCmabClient clientSpy = spy(realClient);
573- // clientSpyContainer[0] = clientSpy; // Store the spy in a container to access it later
574- // return clientSpy;
575- // });
576- //
577- // // Build the manager with the custom endpoint
578- //
579- // OptimizelyManager manager = OptimizelyManager.builder(testProjectId)
580- // .withCmabPredictionEndpoint(customCmabEndpoint)
581- // .build(mockContext);
582- //
583- // // Assert
584- //
585- // DefaultCmabClient capturedClient = clientSpyContainer[0];
586- // assertNotNull("The DefaultCmabClient spy should have been captured", capturedClient);
587- //
588- // CmabClientHelperAndroid helper = capturedClient.getCmabClientHelper();
589- // Assert.assertEquals("The helper endpoint should have been updated", customCmabEndpoint, helper.getCmabPredictionEndpoint());
590- //
591- // verify(mockBuilder).withClient(eq(capturedClient));
592- // verify(mockBuilder).build();
593- // }
594- //
549+
595550 @ Test
596551 public void testCmabServiceDefaultConfigurationValidation () throws Exception {
597552 // Default configuration values
0 commit comments