Skip to content

Commit

Permalink
Remove tenant user for GraphQL sub tests due to wso2#12621
Browse files Browse the repository at this point in the history
  • Loading branch information
wasuradananjith committed Mar 10, 2022
1 parent fa3b0b8 commit 7d20fd8
Showing 1 changed file with 15 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ public GraphqlSubscriptionTestCase(TestUserMode userMode) {

@DataProvider
public static Object[][] userModeDataProvider() {
return new Object[][]{new Object[]{TestUserMode.SUPER_TENANT_ADMIN},
new Object[]{TestUserMode.TENANT_ADMIN}};
// Removed the tenant user due to https://github.com/wso2/product-apim/issues/12621
// Need to revisit this
return new Object[][] { new Object[] { TestUserMode.SUPER_TENANT_ADMIN } };
}

@BeforeClass(alwaysRun = true)
Expand Down Expand Up @@ -425,7 +426,7 @@ public void testGraphQLAPIInvocationWithScopes() throws Exception {
// Create Revision and Deploy to Gateway
createAPIRevisionAndDeployUsingRest(graphqlApiId, restAPIPublisher);
// Keep sufficient time to update map
Thread.sleep(10000);
Thread.sleep(20000);
waitForAPIDeploymentSync(apidto.getProvider(), apidto.getName(), apidto.getVersion(),
APIMIntegrationConstants.IS_API_EXISTS);
// generate token
Expand Down Expand Up @@ -489,7 +490,7 @@ public void testGraphQLAPIInvocationWithScopes() throws Exception {
// Create Revision and Deploy to Gateway
createAPIRevisionAndDeployUsingRest(graphqlApiId, restAPIPublisher);
// Keep sufficient time to update map
Thread.sleep(10000);
Thread.sleep(20000);
waitForAPIDeploymentSync(apidto.getProvider(), apidto.getName(), apidto.getVersion(),
APIMIntegrationConstants.IS_API_EXISTS);
}
Expand Down Expand Up @@ -591,8 +592,8 @@ private void invokeGraphQLSubscriptionSuccess(WebSocketClient client, String acc
textMessage = "{\"type\":\"connection_init\",\"payload\":{}}";
Thread.sleep(20000);
socket.sendMessage(textMessage);
Thread.sleep(20000);
waitForReply(socket);
Thread.sleep(40000);
assertFalse(StringUtils.isEmpty(socket.getResponseMessage()),
"Client did not receive response from server");
assertEquals(socket.getResponseMessage(), "{\"type\":\"connection_ack\"}",
Expand All @@ -602,9 +603,7 @@ private void invokeGraphQLSubscriptionSuccess(WebSocketClient client, String acc
textMessage = "{\"id\":\"1\",\"type\":\"start\",\"payload\":{\"variables\":{},\"extensions\":{},"
+ "\"operationName\":null,\"query\":"
+ "\"subscription {\\n liftStatusChange {\\n name\\n }\\n}\\n\"}}";
Thread.sleep(20000);
socket.sendMessage(textMessage);
Thread.sleep(20000);
waitForReply(socket);
assertFalse(StringUtils.isEmpty(socket.getResponseMessage()),
"Client did not receive response from server");
Expand Down Expand Up @@ -789,6 +788,7 @@ private void invokeGraphQLSubscriptionScopeInvalidError(WebSocketClient client,
socket.sendMessage(textMessage);
Thread.sleep(20000);
waitForReply(socket);
Thread.sleep(20000);
assertFalse(StringUtils.isEmpty(socket.getResponseMessage()),
"Client did not receive response from server");
assertEquals(socket.getResponseMessage(), "{\"type\":\"connection_ack\"}",
Expand All @@ -798,9 +798,7 @@ private void invokeGraphQLSubscriptionScopeInvalidError(WebSocketClient client,
textMessage = "{\"id\":\"1\",\"type\":\"start\",\"payload\":{\"variables\":{},\"extensions\":{},"
+ "\"operationName\":null,\"query\":"
+ "\"subscription {\\n liftStatusChange {\\n name\\n }\\n}\\n\"}}";
Thread.sleep(20000);
socket.sendMessage(textMessage);
Thread.sleep(20000);
waitForReply(socket);
assertFalse(StringUtils.isEmpty(socket.getResponseMessage()),
"Client did not receive response from server");
Expand Down Expand Up @@ -844,6 +842,7 @@ private void invokeGraphQLSubscriptionForComplexityError(WebSocketClient client,
socket.sendMessage(textMessage);
Thread.sleep(20000);
waitForReply(socket);
Thread.sleep(20000);
assertFalse(StringUtils.isEmpty(socket.getResponseMessage()),
"Client did not receive response from server");
assertEquals(socket.getResponseMessage(), "{\"type\":\"connection_ack\"}",
Expand All @@ -853,9 +852,7 @@ private void invokeGraphQLSubscriptionForComplexityError(WebSocketClient client,
textMessage = "{\"id\":\"1\",\"type\":\"start\",\"payload\":{\"variables\":{},\"extensions\":{},"
+ "\"operationName\":null,\"query\": \"subscription {\\n "
+ "liftStatusChange {\\n name\\n id\\n status\\n night\\n capacity\\n }\\n}\\n\"}}";
Thread.sleep(20000);
socket.sendMessage(textMessage);
Thread.sleep(20000);
waitForReply(socket);
assertFalse(StringUtils.isEmpty(socket.getResponseMessage()),
"Client did not receive response from server");
Expand Down Expand Up @@ -896,10 +893,11 @@ private void invokeGraphQLSubscriptionForDepthError(WebSocketClient client, Stri
String textMessage;
//Send connection init message
textMessage = "{\"type\":\"connection_init\",\"payload\":{}}";
Thread.sleep(20000);
Thread.sleep(40000);
socket.sendMessage(textMessage);
Thread.sleep(20000);
Thread.sleep(30000);
waitForReply(socket);
Thread.sleep(30000);
assertFalse(StringUtils.isEmpty(socket.getResponseMessage()),
"Client did not receive response from server");
assertEquals(socket.getResponseMessage(), "{\"type\":\"connection_ack\"}",
Expand All @@ -909,9 +907,7 @@ private void invokeGraphQLSubscriptionForDepthError(WebSocketClient client, Stri
textMessage = "{\"id\":\"1\",\"type\":\"start\",\"payload\":{\"variables\":{},\"extensions\":{},"
+ "\"operationName\":null,\"query\": \"subscription {\\n "
+ "liftStatusChange {\\n name\\n}\\n}\\n\"}}";
Thread.sleep(20000);
socket.sendMessage(textMessage);
Thread.sleep(20000);
waitForReply(socket);
assertFalse(StringUtils.isEmpty(socket.getResponseMessage()),
"Client did not receive response from server");
Expand Down Expand Up @@ -952,10 +948,11 @@ private void invokeGraphQLSubscriptionForInvalidPayloadError(WebSocketClient cli
String textMessage;
//Send connection init message
textMessage = "{\"type\":\"connection_init\",\"payload\":{}}";
Thread.sleep(20000);
Thread.sleep(40000);
socket.sendMessage(textMessage);
Thread.sleep(20000);
Thread.sleep(30000);
waitForReply(socket);
Thread.sleep(30000);
assertFalse(StringUtils.isEmpty(socket.getResponseMessage()),
"Client did not receive response from server");
assertEquals(socket.getResponseMessage(), "{\"type\":\"connection_ack\"}",
Expand All @@ -965,9 +962,7 @@ private void invokeGraphQLSubscriptionForInvalidPayloadError(WebSocketClient cli
textMessage = "{\"id\":\"1\",\"type\":\"start\",\"payload\":{\"variables\":{},\"extensions\":{},"
+ "\"operationName\":null,\"query\": \"subscription {\\n "
+ "liftStatusChange {\\n name\\n invalidField\\n }\\n}\\n\"}}";
Thread.sleep(20000);
socket.sendMessage(textMessage);
Thread.sleep(20000);
waitForReply(socket);
assertFalse(StringUtils.isEmpty(socket.getResponseMessage()),
"Client did not receive response from server");
Expand Down Expand Up @@ -1009,6 +1004,7 @@ private void testThrottling(String accessToken) throws Exception {
String textMessage;
//Send connection init message
textMessage = "{\"type\":\"connection_init\",\"payload\":{}}";
Thread.sleep(10000);
socket.sendMessage(textMessage);
waitForReply(socket);
assertFalse(StringUtils.isEmpty(socket.getResponseMessage()),
Expand Down

0 comments on commit 7d20fd8

Please sign in to comment.