diff options
author | Martin Polden <mpolden@mpolden.no> | 2021-09-08 13:46:20 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2021-09-08 13:58:51 +0200 |
commit | 3b2adb1409564acc448607a29ef40e55dc9aa2c1 (patch) | |
tree | f4fbeabe7b3222127ac07bd707f91a444e21c2f7 /client/go/cmd/deploy_test.go | |
parent | de3fa4f928ad39863afdb75f61373de9eea3f90d (diff) |
Check service convergence when waiting for local deployment
Diffstat (limited to 'client/go/cmd/deploy_test.go')
-rw-r--r-- | client/go/cmd/deploy_test.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/client/go/cmd/deploy_test.go b/client/go/cmd/deploy_test.go index 0e53feddbaf..ff85cd3d835 100644 --- a/client/go/cmd/deploy_test.go +++ b/client/go/cmd/deploy_test.go @@ -111,7 +111,7 @@ func assertDeploy(applicationPackage string, arguments []string, t *testing.T) { func assertPrepare(applicationPackage string, arguments []string, t *testing.T) { client := &mockHttpClient{} - client.nextBody = `{"session-id":"42"}` + client.NextResponse(200, `{"session-id":"42"}`) assert.Equal(t, "Success: Prepared "+applicationPackage+" with session 42\n", executeCommand(t, client, arguments, []string{})) @@ -155,14 +155,16 @@ func assertDeployRequestMade(target string, client *mockHttpClient, t *testing.T } func assertApplicationPackageError(t *testing.T, command string, status int, expectedMessage string, returnBody string) { - client := &mockHttpClient{nextStatus: status, nextBody: returnBody} + client := &mockHttpClient{} + client.NextResponse(status, returnBody) assert.Equal(t, "Error: Invalid application package (Status "+strconv.Itoa(status)+")\n\n"+expectedMessage+"\n", executeCommand(t, client, []string{command, "testdata/applications/withTarget/target/application.zip"}, []string{})) } func assertDeployServerError(t *testing.T, status int, errorMessage string) { - client := &mockHttpClient{nextStatus: status, nextBody: errorMessage} + client := &mockHttpClient{} + client.NextResponse(status, errorMessage) assert.Equal(t, "Error: Error from deploy service at 127.0.0.1:19071 (Status "+strconv.Itoa(status)+"):\n"+errorMessage+"\n", executeCommand(t, client, []string{"deploy", "testdata/applications/withTarget/target/application.zip"}, []string{})) |