@@ -15,11 +15,14 @@ package ack
15
15
16
16
import (
17
17
"testing"
18
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
19
+ k8srt "k8s.io/apimachinery/pkg/runtime"
18
20
19
21
"github.com/stretchr/testify/require"
20
22
21
23
ackv1alpha1 "github.com/aws-controllers-k8s/runtime/apis/core/v1alpha1"
22
24
acktypes "github.com/aws-controllers-k8s/runtime/pkg/types"
25
+ ackcompare "github.com/aws-controllers-k8s/runtime/pkg/compare"
23
26
)
24
27
25
28
type fakeIdentifiers struct {}
@@ -34,6 +37,38 @@ func (ids *fakeIdentifiers) OwnerAccountID() *ackv1alpha1.AWSAccountID {
34
37
return & owner
35
38
}
36
39
40
+ type fakeDescriptor struct {}
41
+
42
+ func (fd * fakeDescriptor ) GroupKind () * metav1.GroupKind {
43
+ return nil
44
+ }
45
+
46
+ func (fd * fakeDescriptor ) EmptyRuntimeObject () k8srt.Object {
47
+ return nil
48
+ }
49
+
50
+ func (fd * fakeDescriptor ) ResourceFromRuntimeObject (o k8srt.Object ) acktypes.AWSResource {
51
+ return nil
52
+ }
53
+
54
+ func (fd * fakeDescriptor ) Delta (a , b acktypes.AWSResource ) * ackcompare.Delta {
55
+ return nil
56
+ }
57
+
58
+ func (fd * fakeDescriptor ) UpdateCRStatus (acktypes.AWSResource ) (bool , error ) {
59
+ return false , nil
60
+ }
61
+
62
+ func (fd * fakeDescriptor ) IsManaged (acktypes.AWSResource ) bool {
63
+ return false
64
+ }
65
+
66
+ func (fd * fakeDescriptor ) MarkManaged (acktypes.AWSResource ) {
67
+ }
68
+
69
+ func (fd * fakeDescriptor ) MarkUnmanaged (acktypes.AWSResource ) {
70
+ }
71
+
37
72
// This test is mostly just a hack to introduce a Go module dependency between
38
73
// the ACK runtime library and the code generator. The code generator doesn't
39
74
// actually depend on Go code in the ACK runtime, but it *produces* templated
@@ -42,4 +77,5 @@ func TestRuntimeDependency(t *testing.T) {
42
77
require := require .New (t )
43
78
44
79
require .Implements ((* acktypes .AWSResourceIdentifiers )(nil ), new (fakeIdentifiers ))
80
+ require .Implements ((* acktypes .AWSResourceDescriptor )(nil ), new (fakeDescriptor ))
45
81
}
0 commit comments