@@ -21,4 +21,56 @@ func (suite *MethodTestSuite) TestLicense() {
21
21
return methodCase (inputs (), asserts (l , rbac .ActionRead ))
22
22
})
23
23
})
24
+ suite .Run ("InsertLicense" , func () {
25
+ suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
26
+ return methodCase (inputs (database.InsertLicenseParams {}), asserts (rbac .ResourceLicense , rbac .ActionCreate ))
27
+ })
28
+ })
29
+ suite .Run ("InsertOrUpdateLogoURL" , func () {
30
+ suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
31
+ return methodCase (inputs ("value" ), asserts (rbac .ResourceDeploymentConfig , rbac .ActionUpdate ))
32
+ })
33
+ })
34
+ suite .Run ("InsertOrUpdateServiceBanner" , func () {
35
+ suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
36
+ return methodCase (inputs ("value" ), asserts (rbac .ResourceDeploymentConfig , rbac .ActionUpdate ))
37
+ })
38
+ })
39
+ suite .Run ("GetLicenseByID" , func () {
40
+ suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
41
+ l , err := db .InsertLicense (context .Background (), database.InsertLicenseParams {
42
+ Uuid : uuid.NullUUID {UUID : uuid .New (), Valid : true },
43
+ })
44
+ require .NoError (t , err )
45
+ return methodCase (inputs (l .ID ), asserts (l , rbac .ActionRead ))
46
+ })
47
+ })
48
+ suite .Run ("DeleteLicense" , func () {
49
+ suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
50
+ l , err := db .InsertLicense (context .Background (), database.InsertLicenseParams {
51
+ Uuid : uuid.NullUUID {UUID : uuid .New (), Valid : true },
52
+ })
53
+ require .NoError (t , err )
54
+ return methodCase (inputs (l .ID ), asserts (l , rbac .ActionDelete ))
55
+ })
56
+ })
57
+ suite .Run ("GetDeploymentID" , func () {
58
+ suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
59
+ return methodCase (inputs (), asserts ())
60
+ })
61
+ })
62
+ suite .Run ("GetLogoURL" , func () {
63
+ suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
64
+ err := db .InsertOrUpdateLogoURL (context .Background (), "value" )
65
+ require .NoError (t , err )
66
+ return methodCase (inputs (), asserts ())
67
+ })
68
+ })
69
+ suite .Run ("GetServiceBanner" , func () {
70
+ suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
71
+ err := db .InsertOrUpdateServiceBanner (context .Background (), "value" )
72
+ require .NoError (t , err )
73
+ return methodCase (inputs (), asserts ())
74
+ })
75
+ })
24
76
}
0 commit comments