@@ -15,11 +15,14 @@ package ack
1515
1616import (
1717 "testing"
18+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
19+ k8srt "k8s.io/apimachinery/pkg/runtime"
1820
1921 "github.com/stretchr/testify/require"
2022
2123 ackv1alpha1 "github.com/aws-controllers-k8s/runtime/apis/core/v1alpha1"
2224 acktypes "github.com/aws-controllers-k8s/runtime/pkg/types"
25+ ackcompare "github.com/aws-controllers-k8s/runtime/pkg/compare"
2326)
2427
2528type fakeIdentifiers struct {}
@@ -34,6 +37,38 @@ func (ids *fakeIdentifiers) OwnerAccountID() *ackv1alpha1.AWSAccountID {
3437 return & owner
3538}
3639
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+
3772// This test is mostly just a hack to introduce a Go module dependency between
3873// the ACK runtime library and the code generator. The code generator doesn't
3974// actually depend on Go code in the ACK runtime, but it *produces* templated
@@ -42,4 +77,5 @@ func TestRuntimeDependency(t *testing.T) {
4277 require := require .New (t )
4378
4479 require .Implements ((* acktypes .AWSResourceIdentifiers )(nil ), new (fakeIdentifiers ))
80+ require .Implements ((* acktypes .AWSResourceDescriptor )(nil ), new (fakeDescriptor ))
4581}
0 commit comments