diff --git a/controller/northbound/server/auth_test.go b/controller/northbound/server/auth_test.go index 6e55b1a7168c388699d38c278207e087786baeb4..5c29f1b84857e18c298d7f2a0a8884d36ff434c2 100644 --- a/controller/northbound/server/auth_test.go +++ b/controller/northbound/server/auth_test.go @@ -11,16 +11,12 @@ import ( ) func Test_auth_Login(t *testing.T) { - type fields struct { - UnimplementedAuthServiceServer apb.UnimplementedAuthServiceServer - } type args struct { ctx context.Context request *apb.LoginRequest } tests := []struct { name string - fields fields args args want string wantErr bool @@ -41,7 +37,7 @@ func Test_auth_Login(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { r := Auth{ - UnimplementedAuthServiceServer: tt.fields.UnimplementedAuthServiceServer, + UnimplementedAuthServiceServer: apb.UnimplementedAuthServiceServer{}, jwtManager: jwt, } resp, err := r.Login(tt.args.ctx, tt.args.request) @@ -63,7 +59,6 @@ func Test_auth_Login(t *testing.T) { func Test_auth_Logout(t *testing.T) { type fields struct { UnimplementedAuthServiceServer apb.UnimplementedAuthServiceServer - jwt rbac.JWTManager } type args struct { ctx context.Context @@ -82,7 +77,6 @@ func Test_auth_Logout(t *testing.T) { t.Run(tt.name, func(t *testing.T) { r := Auth{ UnimplementedAuthServiceServer: tt.fields.UnimplementedAuthServiceServer, - jwtManager: &tt.fields.jwt, } got, err := r.Logout(tt.args.ctx, tt.args.request) if (err != nil) != tt.wantErr { diff --git a/controller/northbound/server/pnd_test.go b/controller/northbound/server/pnd_test.go index f95be5acc5af3975b87e3dd3d8151a57c5181466..64fd8a80fb533f573ea86a64153a56cc21b0474e 100644 --- a/controller/northbound/server/pnd_test.go +++ b/controller/northbound/server/pnd_test.go @@ -15,6 +15,7 @@ import ( "code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound" "code.fbi.h-da.de/danet/gosdn/controller/mocks" "code.fbi.h-da.de/danet/gosdn/controller/nucleus" + "code.fbi.h-da.de/danet/gosdn/controller/rbac" "code.fbi.h-da.de/danet/yang-models/generated/openconfig" "github.com/golang/protobuf/proto" "github.com/google/go-cmp/cmp" @@ -147,6 +148,9 @@ func TestMain(m *testing.M) { log.Fatal(err) } + userc = rbac.NewUserStore() + rolec = rbac.NewRoleStore() + os.Exit(m.Run()) }