@@ -886,18 +886,20 @@ func TestNginx_Process_handleConfigApplyRequest(t *testing.T) {
886886 dataPlaneResponse .GetCommandResponse ().GetMessage ())
887887 assert .Equal (t , test .configApplyReturnsErr .Error (), dataPlaneResponse .GetCommandResponse ().GetError ())
888888
889- dataPlaneResponse , ok = messages [1 ].Data .(* mpi.DataPlaneResponse )
889+ assert .Equal (t , bus .EnableWatchersTopic , messages [1 ].Topic )
890+
891+ dataPlaneResponse , ok = messages [2 ].Data .(* mpi.DataPlaneResponse )
890892 assert .True (t , ok )
891893 assert .Equal (t , "Config apply failed, rollback successful" ,
892894 dataPlaneResponse .GetCommandResponse ().GetMessage ())
893895 assert .Equal (t , mpi .CommandResponse_COMMAND_STATUS_FAILURE ,
894896 dataPlaneResponse .GetCommandResponse ().GetStatus ())
895897
896- assert .Equal (t , bus .EnableWatchersTopic , messages [2 ].Topic )
897898 case test .configApplyStatus == model .NoChange :
898899 assert .Len (t , messages , 2 )
900+ assert .Equal (t , bus .EnableWatchersTopic , messages [0 ].Topic )
899901
900- response , ok := messages [0 ].Data .(* mpi.DataPlaneResponse )
902+ response , ok := messages [1 ].Data .(* mpi.DataPlaneResponse )
901903 assert .True (t , ok )
902904 assert .Equal (t , 1 , fakeFileManagerService .ClearCacheCallCount ())
903905 assert .Equal (
@@ -911,13 +913,13 @@ func TestNginx_Process_handleConfigApplyRequest(t *testing.T) {
911913 response .GetCommandResponse ().GetStatus (),
912914 )
913915
914- assert .Equal (t , bus .EnableWatchersTopic , messages [1 ].Topic )
915-
916916 case test .message == nil :
917917 assert .Empty (t , messages )
918918 default :
919919 assert .Len (t , messages , 2 )
920- dataPlaneResponse , ok := messages [0 ].Data .(* mpi.DataPlaneResponse )
920+ assert .Equal (t , bus .EnableWatchersTopic , messages [0 ].Topic )
921+
922+ dataPlaneResponse , ok := messages [1 ].Data .(* mpi.DataPlaneResponse )
921923 assert .True (t , ok )
922924 assert .Equal (
923925 t ,
@@ -926,7 +928,6 @@ func TestNginx_Process_handleConfigApplyRequest(t *testing.T) {
926928 )
927929 assert .Equal (t , "Config apply failed" , dataPlaneResponse .GetCommandResponse ().GetMessage ())
928930 assert .Equal (t , test .configApplyReturnsErr .Error (), dataPlaneResponse .GetCommandResponse ().GetError ())
929- assert .Equal (t , bus .EnableWatchersTopic , messages [1 ].Topic )
930931 }
931932 })
932933 }
0 commit comments