From fe87a63a34068358af0e662a1d0516eef4c89dc9 Mon Sep 17 00:00:00 2001 From: DinethH Date: Tue, 30 Apr 2024 09:30:49 +0530 Subject: [PATCH] Slight change to test --- test/cucumber-tests/scripts/setup-hosts.sh | 1 + .../src/test/java/org/wso2/apk/integration/api/BaseSteps.java | 2 +- .../integration/utils/clients/SimpleGRPCStudentClient.java | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/cucumber-tests/scripts/setup-hosts.sh b/test/cucumber-tests/scripts/setup-hosts.sh index 5fb451248..2f541a7b5 100644 --- a/test/cucumber-tests/scripts/setup-hosts.sh +++ b/test/cucumber-tests/scripts/setup-hosts.sh @@ -6,6 +6,7 @@ kubectl wait deployment/backend-retry-deployment -n apk-integration-test --for=c kubectl wait deployment/dynamic-backend -n apk-integration-test --for=condition=available --timeout=600s kubectl wait deployment/interceptor-service-deployment -n apk-integration-test --for=condition=available --timeout=600s kubectl wait deployment/graphql-faker -n apk-integration-test --for=condition=available --timeout=600s +kubectl wait deployment/grpc-backend -n apk-integration-test --for=condition=available --timeout=600s kubectl wait --timeout=5m -n apk-integration-test deployment/apk-test-setup-wso2-apk-adapter-deployment --for=condition=Available kubectl wait --timeout=15m -n apk-integration-test deployment/apk-test-setup-wso2-apk-gateway-runtime-deployment --for=condition=Available IP=$(kubectl get svc apk-test-setup-wso2-apk-gateway-service -n apk-integration-test --output jsonpath='{.status.loadBalancer.ingress[0].ip}') diff --git a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/api/BaseSteps.java b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/api/BaseSteps.java index cba1b1530..d31b2c245 100644 --- a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/api/BaseSteps.java +++ b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/api/BaseSteps.java @@ -180,7 +180,7 @@ public void GetStudent(String arg0, int arg1) throws StatusRuntimeException { public void GetStudentDefaultVersion(String arg0, int arg1) throws StatusRuntimeException { try { SimpleGRPCStudentClient grpcStudentClient = new SimpleGRPCStudentClient(arg0, arg1); - sharedContext.setStudentResponse(grpcStudentClient.GetStudent(sharedContext.getHeaders())); + sharedContext.setStudentResponse(grpcStudentClient.GetStudentDefaultVersion(sharedContext.getHeaders())); } catch (StatusRuntimeException e) { if (e.getStatus().getCode()== Status.Code.PERMISSION_DENIED){ sharedContext.setGrpcErrorCode(403); diff --git a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/SimpleGRPCStudentClient.java b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/SimpleGRPCStudentClient.java index c7f04210b..0f7ba0b98 100644 --- a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/SimpleGRPCStudentClient.java +++ b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/SimpleGRPCStudentClient.java @@ -44,10 +44,12 @@ public StudentResponse GetStudent(Map headers) throws StatusRunt .build(); StudentServiceGrpc.StudentServiceBlockingStub blockingStub = StudentServiceGrpc.newBlockingStub(managedChannel); if (blockingStub == null) { + log.error("Failed to create blocking stub"); throw new RuntimeException("Failed to create blocking stub"); } StudentResponse response = blockingStub.getStudent(StudentRequest.newBuilder().setId(1).build()); if (response == null) { + log.error("Failed to get student"); throw new RuntimeException("Failed to get student"); } return response; @@ -82,10 +84,12 @@ public StudentResponse GetStudentDefaultVersion(Map headers) thr .build(); StudentServiceDefaultVersionGrpc.StudentServiceBlockingStub blockingStub = StudentServiceDefaultVersionGrpc.newBlockingStub(managedChannel); if (blockingStub == null) { + log.error("Failed to create blocking stub"); throw new RuntimeException("Failed to create blocking stub"); } StudentResponse response = blockingStub.getStudent(StudentRequest.newBuilder().setId(1).build()); if (response == null) { + log.error("Failed to get student"); throw new RuntimeException("Failed to get student"); } return response;