Skip to content
This repository was archived by the owner on Oct 23, 2025. It is now read-only.

Commit 3835983

Browse files
authored
Fixing the failing test cases for tagging related changes. (#80)
1 parent ab5cb72 commit 3835983

File tree

1 file changed

+2
-22
lines changed
  • aws-redshiftserverless-workgroup/src/test/java/software/amazon/redshiftserverless/workgroup

1 file changed

+2
-22
lines changed

aws-redshiftserverless-workgroup/src/test/java/software/amazon/redshiftserverless/workgroup/UpdateHandlerTest.java

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -82,26 +82,6 @@ public void handleRequest_SimpleSuccess() {
8282
assertThat(response.getErrorCode()).isNull();
8383
}
8484

85-
@Test
86-
public void handleRequest_NoReadTagsPermissions() {
87-
final UpdateHandler handler = new UpdateHandler();
88-
89-
final ResourceModel responseResourceModel = updateResponseResourceModel();
90-
91-
final ResourceHandlerRequest<ResourceModel> request = ResourceHandlerRequest.<ResourceModel>builder()
92-
.previousResourceState(createRequestResourceModel())
93-
.desiredResourceState(updateRequestResourceModel())
94-
.build();
95-
96-
when(proxyClient.client().listTagsForResource(any(ListTagsForResourceRequest.class))).thenThrow(ValidationException.builder().build());
97-
when(proxyClient.client().getWorkgroup(any(GetWorkgroupRequest.class))).thenReturn(getReadResponseSdk());
98-
99-
final ProgressEvent<ResourceModel, CallbackContext> response = handler.handleRequest(proxy, request, new CallbackContext(), proxyClient, logger);
100-
101-
assertThat(response).isNotNull();
102-
assertThat(response.getStatus()).isEqualTo(OperationStatus.FAILED);
103-
}
104-
10585
@Test
10686
public void handleRequest_RestoreFromSnapshot_Success() {
10787
final UpdateHandler handler = new UpdateHandler();
@@ -116,6 +96,7 @@ public void handleRequest_RestoreFromSnapshot_Success() {
11696
.desiredResourceState(requestModel)
11797
.build();
11898

99+
when(proxyClient.client().listTagsForResource(any(ListTagsForResourceRequest.class))).thenReturn(ListTagsForResourceResponse.builder().build());
119100
when(proxyClient.client().updateWorkgroup(any(UpdateWorkgroupRequest.class))).thenReturn(updateResponseSdk());
120101
when(proxyClient.client().getWorkgroup(any(GetWorkgroupRequest.class))).thenReturn(getReadResponseSdk());
121102
when(proxyClient.client().restoreFromSnapshot(any(RestoreFromSnapshotRequest.class))).thenReturn(
@@ -145,8 +126,7 @@ public void handleRequest_RestoreFromSnapshot_Failed() {
145126
.previousResourceState(createRequestResourceModel())
146127
.desiredResourceState(requestModel)
147128
.build();
148-
149-
when(proxyClient.client().listTagsForResource(any(ListTagsForResourceRequest.class))).thenReturn(ListTagsForResourceResponse.builder().build());
129+
150130
when(proxyClient.client().updateWorkgroup(any(UpdateWorkgroupRequest.class))).thenReturn(updateResponseSdk());
151131
when(proxyClient.client().getWorkgroup(any(GetWorkgroupRequest.class))).thenReturn(getReadResponseSdk());
152132
when(proxyClient.client().restoreFromSnapshot(any(RestoreFromSnapshotRequest.class))).thenThrow(ValidationException.builder().build());

0 commit comments

Comments
 (0)