File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
application/commands/application Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ package application
22
33import (
44 "errors"
5+ "flag"
6+ "github.com/urfave/cli"
57 "testing"
68
79 "github.com/jfrog/jfrog-cli-application/application/model"
@@ -64,17 +66,20 @@ func TestCreateAppCommand_Error(t *testing.T) {
6466func TestCreateAppCommand_WrongNumberOfArguments (t * testing.T ) {
6567 ctrl := gomock .NewController (t )
6668 defer ctrl .Finish ()
69+ app := cli .NewApp ()
70+ set := flag .NewFlagSet ("test" , 0 )
71+ ctx := cli .NewContext (app , set , nil )
6772
6873 mockAppService := mockapps .NewMockApplicationService (ctrl )
6974 cmd := & createAppCommand {
7075 applicationService : mockAppService ,
7176 }
7277
7378 // Test with no arguments
74- ctx := & components.Context {
75- Arguments : [] string {},
76- }
77- err : = cmd .prepareAndRunCommand (ctx )
79+ context , err := components .ConvertContext ( ctx )
80+ assert . NoError ( t , err )
81+
82+ err = cmd .prepareAndRunCommand (context )
7883 assert .Error (t , err )
79- assert .Contains (t , err .Error (), "exactly one application key is required " )
84+ assert .Contains (t , err .Error (), "Wrong number of arguments " )
8085}
You can’t perform that action at this time.
0 commit comments