Skip to content

Commit 2837017

Browse files
committed
fix tests
1 parent af9600b commit 2837017

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

internal/nginx/nginx_plugin_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,9 @@ func TestNginxPlugin_Failed_ConfigApply(t *testing.T) {
10001000

10011001
if tt.rollbackError == nil && tt.rollbackWriteError == nil {
10021002
assert.Len(t, messages, 3)
1003-
dataPlaneResponse, ok = messages[1].Data.(*mpi.DataPlaneResponse)
1003+
assert.Equal(t, bus.EnableWatchersTopic, messages[1].Topic)
1004+
1005+
dataPlaneResponse, ok = messages[2].Data.(*mpi.DataPlaneResponse)
10041006
assert.True(t, ok)
10051007
assert.Equal(
10061008
t,
@@ -1010,7 +1012,6 @@ func TestNginxPlugin_Failed_ConfigApply(t *testing.T) {
10101012

10111013
assert.Equal(t, "Config apply failed, rollback successful",
10121014
dataPlaneResponse.GetCommandResponse().GetMessage())
1013-
assert.Equal(t, bus.EnableWatchersTopic, messages[2].Topic)
10141015
} else {
10151016
assert.Len(t, messages, 4)
10161017
dataPlaneResponse, ok = messages[1].Data.(*mpi.DataPlaneResponse)
@@ -1022,8 +1023,9 @@ func TestNginxPlugin_Failed_ConfigApply(t *testing.T) {
10221023
)
10231024

10241025
assert.Equal(t, "Rollback failed", dataPlaneResponse.GetCommandResponse().GetMessage())
1026+
assert.Equal(t, bus.EnableWatchersTopic, messages[2].Topic)
10251027

1026-
dataPlaneResponse, ok = messages[2].Data.(*mpi.DataPlaneResponse)
1028+
dataPlaneResponse, ok = messages[3].Data.(*mpi.DataPlaneResponse)
10271029
assert.True(t, ok)
10281030
assert.Equal(
10291031
t,
@@ -1034,7 +1036,6 @@ func TestNginxPlugin_Failed_ConfigApply(t *testing.T) {
10341036
assert.Equal(t, "Config apply failed, rollback failed",
10351037
dataPlaneResponse.GetCommandResponse().GetMessage())
10361038
assert.Equal(t, tt.message, dataPlaneResponse.GetCommandResponse().GetError())
1037-
assert.Equal(t, bus.EnableWatchersTopic, messages[3].Topic)
10381039
}
10391040
})
10401041
}

0 commit comments

Comments
 (0)