Skip to content
Snippets Groups Projects
Commit 1b912c21 authored by André Sterba's avatar André Sterba
Browse files

Merge branch 'istaester/nbi-to-nib-refactoring' into istaester/init-application-framework

parents 913ce73a 6ff8237e
No related branches found
No related tags found
2 merge requests!376Add additional example application hostname-checker,!343Add basic application framework and example application to show interaction between events an NBI
Pipeline #107500 failed
This commit is part of merge request !343. Comments created here will be created in the context of that merge request.
...@@ -61,7 +61,7 @@ func TestGetRole(t *testing.T) { ...@@ -61,7 +61,7 @@ func TestGetRole(t *testing.T) {
ctx context.Context ctx context.Context
addr string addr string
name string name string
uuid uuid.UUID id uuid.UUID
} }
tests := []struct { tests := []struct {
name string name string
...@@ -75,6 +75,7 @@ func TestGetRole(t *testing.T) { ...@@ -75,6 +75,7 @@ func TestGetRole(t *testing.T) {
ctx: context.TODO(), ctx: context.TODO(),
addr: testAPIEndpoint, addr: testAPIEndpoint,
name: "adminTestRole", name: "adminTestRole",
id: uuid.Nil,
}, },
want: &apb.GetRoleResponse{ want: &apb.GetRoleResponse{
Status: apb.Status_STATUS_OK, Status: apb.Status_STATUS_OK,
...@@ -91,6 +92,7 @@ func TestGetRole(t *testing.T) { ...@@ -91,6 +92,7 @@ func TestGetRole(t *testing.T) {
ctx: context.TODO(), ctx: context.TODO(),
addr: testAPIEndpoint, addr: testAPIEndpoint,
name: "not role", name: "not role",
id: uuid.Nil,
}, },
want: nil, want: nil,
wantErr: true, wantErr: true,
...@@ -98,7 +100,7 @@ func TestGetRole(t *testing.T) { ...@@ -98,7 +100,7 @@ func TestGetRole(t *testing.T) {
} }
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
got, err := GetRole(tt.args.ctx, tt.args.addr, tt.args.name, tt.args.uuid) got, err := GetRole(tt.args.ctx, tt.args.addr, tt.args.name, tt.args.id)
if (err != nil) != tt.wantErr { if (err != nil) != tt.wantErr {
t.Errorf("GetRole() error = %v, wantErr %v", err, tt.wantErr) t.Errorf("GetRole() error = %v, wantErr %v", err, tt.wantErr)
return return
......
...@@ -79,6 +79,7 @@ func TestGetUser(t *testing.T) { ...@@ -79,6 +79,7 @@ func TestGetUser(t *testing.T) {
ctx: context.TODO(), ctx: context.TODO(),
addr: testAPIEndpoint, addr: testAPIEndpoint,
name: "testAdmin", name: "testAdmin",
id: uuid.Nil,
}, },
want: &apb.GetUserResponse{ want: &apb.GetUserResponse{
Status: apb.Status_STATUS_OK, Status: apb.Status_STATUS_OK,
...@@ -95,6 +96,7 @@ func TestGetUser(t *testing.T) { ...@@ -95,6 +96,7 @@ func TestGetUser(t *testing.T) {
ctx: context.TODO(), ctx: context.TODO(),
addr: testAPIEndpoint, addr: testAPIEndpoint,
name: "foos", name: "foos",
id: uuid.Nil,
}, },
want: nil, want: nil,
wantErr: true, wantErr: true,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment