Skip to content

Commit

Permalink
Linted code
Browse files Browse the repository at this point in the history
Signed-off-by: nyagamunene <[email protected]>
  • Loading branch information
nyagamunene committed Apr 18, 2024
1 parent a04f075 commit 161e57a
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions consumers/notifiers/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,38 +42,38 @@ func TestCreateSubscription(t *testing.T) {
svc, auth, repo := newService()

cases := []struct {
desc string
token string
sub notifiers.Subscription
id string
err error
desc string
token string
sub notifiers.Subscription
id string
err error
identifyErr error
identityRes *magistrala.IdentityRes
}{
{
desc: "test success",
token: exampleUser1,
sub: notifiers.Subscription{Contact: exampleUser1, Topic: "valid.topic"},
id: uuid.Prefix + fmt.Sprintf("%012d", 1),
err: nil,
desc: "test success",
token: exampleUser1,
sub: notifiers.Subscription{Contact: exampleUser1, Topic: "valid.topic"},
id: uuid.Prefix + fmt.Sprintf("%012d", 1),
err: nil,
identifyErr: nil,
identityRes: &magistrala.IdentityRes{Id: validID},
},
{
desc: "test already existing",
token: exampleUser1,
sub: notifiers.Subscription{Contact: exampleUser1, Topic: "valid.topic"},
id: "",
err: repoerr.ErrConflict,
desc: "test already existing",
token: exampleUser1,
sub: notifiers.Subscription{Contact: exampleUser1, Topic: "valid.topic"},
id: "",
err: repoerr.ErrConflict,
identifyErr: nil,
identityRes: &magistrala.IdentityRes{Id: validID},
},
{
desc: "test with empty token",
token: "",
sub: notifiers.Subscription{Contact: exampleUser1, Topic: "valid.topic"},
id: "",
err: svcerr.ErrAuthentication,
desc: "test with empty token",
token: "",
sub: notifiers.Subscription{Contact: exampleUser1, Topic: "valid.topic"},
id: "",
err: svcerr.ErrAuthentication,
identifyErr: svcerr.ErrAuthentication,
},
}
Expand Down

0 comments on commit 161e57a

Please sign in to comment.