@@ -22,36 +22,26 @@ const (
22
22
func TestNewCertificate (t * testing.T ) {
23
23
ctx := context .Background ()
24
24
25
- certificates , err := NewCertificates (ctx , nil )
26
-
27
- if err != nil {
28
- t .Fatalf (`Unexpected error: %v` , err )
29
- }
25
+ certificates := NewCertificates (ctx , nil )
30
26
31
27
if certificates == nil {
32
28
t .Fatalf (`certificates should not be nil` )
33
29
}
34
30
}
35
31
36
32
func TestCertificates_Initialize (t * testing.T ) {
37
- certificates , err := NewCertificates (context .Background (), nil )
38
- if err != nil {
39
- t .Fatalf (`Unexpected error: %v` , err )
40
- }
33
+ certificates := NewCertificates (context .Background (), nil )
41
34
42
- err = certificates .Initialize ()
35
+ err : = certificates .Initialize ()
43
36
if err != nil {
44
37
t .Fatalf (`Unexpected error: %v` , err )
45
38
}
46
39
}
47
40
48
41
func TestCertificates_RunWithoutInitialize (t * testing.T ) {
49
- certificates , err := NewCertificates (context .Background (), nil )
50
- if err != nil {
51
- t .Fatalf (`Unexpected error: %v` , err )
52
- }
42
+ certificates := NewCertificates (context .Background (), nil )
53
43
54
- err = certificates .Run ()
44
+ err : = certificates .Run ()
55
45
if err == nil {
56
46
t .Fatalf (`Expected error` )
57
47
}
@@ -62,12 +52,9 @@ func TestCertificates_RunWithoutInitialize(t *testing.T) {
62
52
}
63
53
64
54
func TestCertificates_EmptyCertificates (t * testing.T ) {
65
- certificates , err := NewCertificates (context .Background (), nil )
66
- if err != nil {
67
- t .Fatalf (`error building Certificates: %v` , err )
68
- }
55
+ certificates := NewCertificates (context .Background (), nil )
69
56
70
- err = certificates .Initialize ()
57
+ err : = certificates .Initialize ()
71
58
if err != nil {
72
59
t .Fatalf (`error Initializing Certificates: %v` , err )
73
60
}
@@ -92,10 +79,7 @@ func TestCertificates_ExerciseHandlers(t *testing.T) {
92
79
93
80
k8sClient := fake .NewSimpleClientset ()
94
81
95
- certificates , err := NewCertificates (ctx , k8sClient )
96
- if err != nil {
97
- t .Fatalf (`error building Certificates: %v` , err )
98
- }
82
+ certificates := NewCertificates (ctx , k8sClient )
99
83
100
84
_ = certificates .Initialize ()
101
85
0 commit comments