2626import com .linkedin .venice .protocols .controller .DeleteAclForStoreGrpcResponse ;
2727import com .linkedin .venice .protocols .controller .GetAclForStoreGrpcRequest ;
2828import com .linkedin .venice .protocols .controller .GetAclForStoreGrpcResponse ;
29- import com .linkedin .venice .protocols .controller .GetStoreStatusRequest ;
30- import com .linkedin .venice .protocols .controller .GetStoreStatusResponse ;
29+ import com .linkedin .venice .protocols .controller .GetClusterHealthStoresGrpcRequest ;
30+ import com .linkedin .venice .protocols .controller .GetClusterHealthStoresGrpcResponse ;
3131import com .linkedin .venice .protocols .controller .ListStoresGrpcRequest ;
3232import com .linkedin .venice .protocols .controller .ListStoresGrpcResponse ;
3333import com .linkedin .venice .protocols .controller .ResourceCleanupCheckGrpcResponse ;
3434import com .linkedin .venice .protocols .controller .StoreGrpcServiceGrpc ;
3535import com .linkedin .venice .protocols .controller .StoreGrpcServiceGrpc .StoreGrpcServiceBlockingStub ;
36- import com .linkedin .venice .protocols .controller .StoreStatus ;
3736import com .linkedin .venice .protocols .controller .UpdateAclForStoreGrpcRequest ;
3837import com .linkedin .venice .protocols .controller .UpdateAclForStoreGrpcResponse ;
3938import com .linkedin .venice .protocols .controller .ValidateStoreDeletedGrpcRequest ;
@@ -454,7 +453,8 @@ public void testListStoresWithFilters() {
454453
455454 @ Test
456455 public void testGetClusterHealthStoresReturnsSuccessfulResponse () {
457- GetStoreStatusRequest request = GetStoreStatusRequest .newBuilder ().setClusterName (TEST_CLUSTER ).build ();
456+ GetClusterHealthStoresGrpcRequest request =
457+ GetClusterHealthStoresGrpcRequest .newBuilder ().setClusterName (TEST_CLUSTER ).build ();
458458 Map <String , String > storeStatusMap = new HashMap <>();
459459 storeStatusMap .put ("store1" , "ONLINE" );
460460 storeStatusMap .put ("store2" , "DEGRADED" );
@@ -464,40 +464,36 @@ public void testGetClusterHealthStoresReturnsSuccessfulResponse() {
464464 handlerResponse .setStoreStatusMap (storeStatusMap );
465465 when (storeRequestHandler .getClusterHealthStores (TEST_CLUSTER )).thenReturn (handlerResponse );
466466
467- GetStoreStatusResponse actualResponse = blockingStub .getClusterHealthStores (request );
467+ GetClusterHealthStoresGrpcResponse actualResponse = blockingStub .getClusterHealthStores (request );
468468
469469 assertNotNull (actualResponse , "Response should not be null" );
470470 assertEquals (actualResponse .getClusterName (), TEST_CLUSTER , "Cluster name should match" );
471- assertEquals (actualResponse .getStoreStatusesCount (), 3 , "Should have 3 stores" );
472-
473- // Verify each store status
474- Map <String , String > responseMap = new HashMap <>();
475- for (StoreStatus status : actualResponse .getStoreStatusesList ()) {
476- responseMap .put (status .getStoreName (), status .getStatus ());
477- }
478- assertEquals (responseMap .get ("store1" ), "ONLINE" , "store1 should be ONLINE" );
479- assertEquals (responseMap .get ("store2" ), "DEGRADED" , "store2 should be DEGRADED" );
480- assertEquals (responseMap .get ("store3" ), "UNAVAILABLE" , "store3 should be UNAVAILABLE" );
471+ assertEquals (actualResponse .getStoreStatusMapMap ().size (), 3 , "Should have 3 stores" );
472+ assertEquals (actualResponse .getStoreStatusMapMap ().get ("store1" ), "ONLINE" , "store1 should be ONLINE" );
473+ assertEquals (actualResponse .getStoreStatusMapMap ().get ("store2" ), "DEGRADED" , "store2 should be DEGRADED" );
474+ assertEquals (actualResponse .getStoreStatusMapMap ().get ("store3" ), "UNAVAILABLE" , "store3 should be UNAVAILABLE" );
481475 }
482476
483477 @ Test
484478 public void testGetClusterHealthStoresReturnsEmptyMapWhenNoStores () {
485- GetStoreStatusRequest request = GetStoreStatusRequest .newBuilder ().setClusterName (TEST_CLUSTER ).build ();
479+ GetClusterHealthStoresGrpcRequest request =
480+ GetClusterHealthStoresGrpcRequest .newBuilder ().setClusterName (TEST_CLUSTER ).build ();
486481 MultiStoreStatusResponse handlerResponse = new MultiStoreStatusResponse ();
487482 handlerResponse .setCluster (TEST_CLUSTER );
488483 handlerResponse .setStoreStatusMap (new HashMap <>());
489484 when (storeRequestHandler .getClusterHealthStores (TEST_CLUSTER )).thenReturn (handlerResponse );
490485
491- GetStoreStatusResponse actualResponse = blockingStub .getClusterHealthStores (request );
486+ GetClusterHealthStoresGrpcResponse actualResponse = blockingStub .getClusterHealthStores (request );
492487
493488 assertNotNull (actualResponse , "Response should not be null" );
494489 assertEquals (actualResponse .getClusterName (), TEST_CLUSTER , "Cluster name should match" );
495- assertEquals (actualResponse .getStoreStatusesCount (), 0 , "Should have 0 stores" );
490+ assertEquals (actualResponse .getStoreStatusMapMap (). size (), 0 , "Should have 0 stores" );
496491 }
497492
498493 @ Test
499494 public void testGetClusterHealthStoresReturnsErrorResponse () {
500- GetStoreStatusRequest request = GetStoreStatusRequest .newBuilder ().setClusterName (TEST_CLUSTER ).build ();
495+ GetClusterHealthStoresGrpcRequest request =
496+ GetClusterHealthStoresGrpcRequest .newBuilder ().setClusterName (TEST_CLUSTER ).build ();
501497 when (storeRequestHandler .getClusterHealthStores (TEST_CLUSTER ))
502498 .thenThrow (new VeniceException ("Failed to get cluster health stores" ));
503499
@@ -514,7 +510,7 @@ public void testGetClusterHealthStoresReturnsErrorResponse() {
514510
515511 @ Test
516512 public void testGetClusterHealthStoresReturnsBadRequestForMissingClusterName () {
517- GetStoreStatusRequest request = GetStoreStatusRequest .newBuilder ().build ();
513+ GetClusterHealthStoresGrpcRequest request = GetClusterHealthStoresGrpcRequest .newBuilder ().build ();
518514 when (storeRequestHandler .getClusterHealthStores ("" ))
519515 .thenThrow (new IllegalArgumentException ("Cluster name is required" ));
520516
0 commit comments