@@ -37,15 +37,17 @@ import (
37
37
)
38
38
39
39
const (
40
- name = "coolGroup"
41
- engineVersionToTest = "5.0.2"
40
+ name = "coolGroup"
41
+ engineVersionToTest = "5.0.2"
42
+ alternateEngineVersionToTest = "6.x"
42
43
)
43
44
44
45
var (
45
46
cacheNodeType = "n1.super.cool"
46
47
autoFailoverEnabled = true
47
48
cacheParameterGroupName = "coolParamGroup"
48
49
engineVersion = "5.0"
50
+ alternateEngineVersion = "6.x"
49
51
port = 6379
50
52
host = "172.16.0.1"
51
53
maintenanceWindow = "tomorrow"
@@ -789,6 +791,54 @@ func TestUpdate(t *testing.T) {
789
791
),
790
792
returnsErr : false ,
791
793
},
794
+ {
795
+ name : "IncreaseReplicationsAndCheckBehaviourVersionx" ,
796
+ e : & external {client : & fake.MockClient {
797
+ MockDescribeReplicationGroups : func (ctx context.Context , _ * elasticache.DescribeReplicationGroupsInput , opts []func (* elasticache.Options )) (* elasticache.DescribeReplicationGroupsOutput , error ) {
798
+ return & elasticache.DescribeReplicationGroupsOutput {
799
+ ReplicationGroups : []types.ReplicationGroup {{
800
+ Status : aws .String (v1beta1 .StatusAvailable ),
801
+ MemberClusters : cacheClusters ,
802
+ AutomaticFailover : types .AutomaticFailoverStatusEnabled ,
803
+ CacheNodeType : aws .String (cacheNodeType ),
804
+ SnapshotRetentionLimit : aws .Int32 (int32 (snapshotRetentionLimit )),
805
+ SnapshotWindow : aws .String (snapshotWindow ),
806
+ ClusterEnabled : aws .Bool (true ),
807
+ ConfigurationEndpoint : & types.Endpoint {Address : aws .String (host ), Port : int32 (port )},
808
+ }},
809
+ }, nil
810
+ },
811
+ MockDescribeCacheClusters : func (ctx context.Context , _ * elasticache.DescribeCacheClustersInput , opts []func (* elasticache.Options )) (* elasticache.DescribeCacheClustersOutput , error ) {
812
+ return & elasticache.DescribeCacheClustersOutput {
813
+ CacheClusters : []types.CacheCluster {
814
+ {EngineVersion : aws .String (engineVersion )},
815
+ {EngineVersion : aws .String (engineVersion )},
816
+ {EngineVersion : aws .String (engineVersion )},
817
+ },
818
+ }, nil
819
+ },
820
+ MockIncreaseReplicaCount : func (ctx context.Context , _ * elasticache.IncreaseReplicaCountInput , opts []func (* elasticache.Options )) (* elasticache.IncreaseReplicaCountOutput , error ) {
821
+ return & elasticache.IncreaseReplicaCountOutput {}, nil
822
+ },
823
+ }},
824
+ r : replicationGroup (
825
+ withEngineVersion (alternateEngineVersionToTest ),
826
+ withReplicationGroupID (name ),
827
+ withProviderStatus (v1beta1 .StatusAvailable ),
828
+ withConditions (xpv1 .Available ()),
829
+ withMemberClusters (cacheClusters ),
830
+ withNumCacheClusters (4 ),
831
+ ),
832
+ want : replicationGroup (
833
+ withEngineVersion (alternateEngineVersion ),
834
+ withReplicationGroupID (name ),
835
+ withProviderStatus (v1beta1 .StatusAvailable ),
836
+ withConditions (xpv1 .Available ()),
837
+ withMemberClusters (cacheClusters ),
838
+ withNumCacheClusters (4 ),
839
+ ),
840
+ returnsErr : false ,
841
+ },
792
842
}
793
843
794
844
for _ , tc := range cases {
0 commit comments