From 183905ba0b7853b710393b8cd05d92aa69d3501f Mon Sep 17 00:00:00 2001 From: sgayangi Date: Wed, 25 Sep 2024 13:38:28 +0530 Subject: [PATCH] Update integration tests for gRPC APIs --- .../envoyconf/routes_with_clusters.go | 2 +- test/cucumber-tests/CRs/artifacts.yaml | 18 +- test/cucumber-tests/build.gradle | 2 + .../wso2/apk/integration/api/BaseSteps.java | 27 +- .../apk/integration/api/SharedContext.java | 2 +- .../clients/SimpleGRPCStudentClient.java | 9 +- .../clients/studentGrpcClient/Student.java | 64 -- .../studentGrpcClient/StudentRequest.java | 518 -------------- .../StudentRequestOrBuilder.java | 16 - .../studentGrpcClient/StudentResponse.java | 665 ------------------ .../StudentResponseOrBuilder.java | 30 - .../StudentServiceDefaultVersionGrpc.java | 435 ------------ .../clients/student_service/Student.java | 77 ++ .../student_service/StudentRequest.java | 465 ++++++++++++ .../StudentRequestOrBuilder.java | 18 + .../student_service/StudentResponse.java | 614 ++++++++++++++++ .../StudentResponseOrBuilder.java | 32 + .../StudentServiceDefaultVersionGrpc.java | 454 ++++++++++++ .../StudentServiceGrpc.java | 119 ++-- .../apk-confs/grpc/generated-grpc.apk-conf | 10 +- .../artifacts/apk-confs/grpc/grpc.apk-conf | 12 +- .../apk-confs/grpc/grpc_scopes.apk-conf | 12 +- .../grpc/grpc_with_default_version.apk-conf | 12 +- .../grpc/grpc_with_disabled_auth.apk-conf | 13 +- ...th_mtls_mandatory_oauth2_disabled.apk-conf | 13 +- ...h_mtls_mandatory_oauth2_mandatory.apk-conf | 13 +- ...ith_mtls_optional_oauth2_optional.apk-conf | 13 +- .../grpc/order-with-endpoints.apk-conf | 28 + .../artifacts/definitions/student.proto | 5 +- .../src/test/resources/tests/api/GRPC.feature | 12 +- .../test/resources/tests/api/GRPCMTLS.feature | 8 +- 31 files changed, 1854 insertions(+), 1864 deletions(-) delete mode 100644 test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/Student.java delete mode 100644 test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentRequest.java delete mode 100644 test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentRequestOrBuilder.java delete mode 100644 test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentResponse.java delete mode 100644 test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentResponseOrBuilder.java delete mode 100644 test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentServiceDefaultVersionGrpc.java create mode 100644 test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/Student.java create mode 100644 test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentRequest.java create mode 100644 test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentRequestOrBuilder.java create mode 100644 test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentResponse.java create mode 100644 test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentResponseOrBuilder.java create mode 100644 test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentServiceDefaultVersionGrpc.java rename test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/{studentGrpcClient => student_service}/StudentServiceGrpc.java (84%) create mode 100644 test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/order-with-endpoints.apk-conf diff --git a/adapter/internal/oasparser/envoyconf/routes_with_clusters.go b/adapter/internal/oasparser/envoyconf/routes_with_clusters.go index b11ad5bed..a7bb76700 100644 --- a/adapter/internal/oasparser/envoyconf/routes_with_clusters.go +++ b/adapter/internal/oasparser/envoyconf/routes_with_clusters.go @@ -1262,7 +1262,7 @@ func createRoutes(params *routeCreateParams) (routes []*routev3.Route, err error temp := removeFirstOccurrence(basePath, "."+version) newRoutePath = "/" + strings.TrimPrefix(resourcePath, temp+".") } - action.Route.RegexRewrite = generateRegexMatchAndSubstitute(rewritePath, newRoutePath, pathMatchType) + // action.Route.RegexRewrite = generateRegexMatchAndSubstitute(rewritePath, newRoutePath, pathMatchType) } route := generateRouteConfig(xWso2Basepath, match, action, nil, metaData, decorator, perRouteFilterConfigs, nil, requestHeadersToRemove, nil, nil) // general headers to add and remove are included in this methods diff --git a/test/cucumber-tests/CRs/artifacts.yaml b/test/cucumber-tests/CRs/artifacts.yaml index 2bbeb801a..f3441fc6f 100644 --- a/test/cucumber-tests/CRs/artifacts.yaml +++ b/test/cucumber-tests/CRs/artifacts.yaml @@ -1740,7 +1740,7 @@ spec: ports: - protocol: TCP port: 6565 - targetPort: 6565 + targetPort: 9090 --- apiVersion: apps/v1 kind: Deployment @@ -1761,20 +1761,10 @@ spec: spec: containers: - name: grpc-backend - image: ddh13/dineth-grpc-demo-server:1.0.0 + image: sega1234/student-service:1.0.0 imagePullPolicy: Always - env: - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - resources: - requests: - cpu: 10m + ports: + - containerPort: 9090 --- apiVersion: dp.wso2.com/v1alpha3 diff --git a/test/cucumber-tests/build.gradle b/test/cucumber-tests/build.gradle index c03a23919..d7e3821d3 100644 --- a/test/cucumber-tests/build.gradle +++ b/test/cucumber-tests/build.gradle @@ -49,6 +49,8 @@ dependencies { implementation 'io.grpc:grpc-netty-shaded:1.57.0' implementation 'io.grpc:grpc-protobuf:1.57.0' implementation 'io.grpc:grpc-stub:1.57.0' + implementation 'io.grpc:grpc-stub:1.57.0' + implementation 'com.google.protobuf:protobuf-java:4.28.2' } test { 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 9f2c924d2..9d0d09795 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 @@ -52,11 +52,10 @@ import org.wso2.apk.integration.utils.Utils; import org.wso2.apk.integration.utils.clients.SimpleGRPCStudentClient; import org.wso2.apk.integration.utils.clients.SimpleHTTPClient; -import org.wso2.apk.integration.utils.clients.studentGrpcClient.StudentResponse; +import org.wso2.apk.integration.utils.clients.student_service.StudentResponse; import org.apache.http.entity.mime.HttpMultipartMode; import org.apache.http.entity.mime.MultipartEntityBuilder; import org.apache.http.entity.ContentType; -import org.wso2.apk.integration.utils.clients.studentGrpcClient.StudentResponse; import org.wso2.apk.integration.utils.clients.SimpleGRPCStudentClient; import java.io.IOException; import java.io.InputStream; @@ -196,7 +195,29 @@ public void theStudentResponseBodyShouldContainNameAndAge(String arg0, int arg1) @Then("the response body should contain endpoint definition for student.proto") public void theResponseBodyShouldContainEndpointDefinition() throws IOException { - String expectedText = "{\"apiDefinition\":\"syntax = \\\"proto3\\\";\\n\\noption java_multiple_files = true;\\noption java_package = \\\"org.example\\\";\\npackage dineth.grpc.api.v1.student;\\n\\nservice StudentService {\\n rpc GetStudent(StudentRequest) returns (StudentResponse) {};\\n rpc GetStudentStream(StudentRequest) returns (stream StudentResponse) {};\\n rpc SendStudentStream(stream StudentRequest) returns (StudentResponse) {};\\n rpc SendAndGetStudentStream(stream StudentRequest) returns (stream StudentResponse) {}\\n}\\n\\nmessage StudentRequest {\\n int32 id = 3;\\n}\\n\\nmessage StudentResponse {\\n string name = 1;\\n int32 age = 2;\\n}\\n\"}"; + String expectedText = "{\"apiDefinition\":\"syntax = \\\"proto3\\\";\\n" + // + "\\n" + // + "package org.apk.v1.student_service;\\n" + // + "\\n" + // + "option java_multiple_files = true;\\n" + // + "option java_package = \\\"org.apk.v1.student_service\\\";\\n" + // + "\\n" + // + "service StudentService {\\n" + // + " rpc GetStudent(StudentRequest) returns (StudentResponse) {};\\n" + // + " rpc GetStudentStream(StudentRequest) returns (stream StudentResponse) {};\\n" + // + " rpc SendStudentStream(stream StudentRequest) returns (StudentResponse) {};\\n" + // + " rpc SendAndGetStudentStream(stream StudentRequest) returns (stream StudentResponse) {}\\n" + // + "}\\n" + // + "\\n" + // + "message StudentRequest {\\n" + // + " int32 id = 3;\\n" + // + "}\\n" + // + "\\n" + // + "message StudentResponse {\\n" + // + " string name = 1;\\n" + // + " int32 age = 2;\\n" + // + "}\\n" + // + "\"}"; Assert.assertTrue(sharedContext.getResponseBody().contains(expectedText), "Actual response body: " + sharedContext.getResponseBody()); } diff --git a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/api/SharedContext.java b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/api/SharedContext.java index dcee4142d..0af3c86dc 100644 --- a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/api/SharedContext.java +++ b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/api/SharedContext.java @@ -19,7 +19,7 @@ import org.apache.http.HttpResponse; import org.wso2.apk.integration.utils.clients.SimpleHTTPClient; -import org.wso2.apk.integration.utils.clients.studentGrpcClient.StudentResponse; +import org.wso2.apk.integration.utils.clients.student_service.StudentResponse; import java.security.KeyManagementException; import java.security.KeyStoreException; 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 29c22b8ef..359b9eb86 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 @@ -7,12 +7,13 @@ import io.netty.handler.ssl.util.InsecureTrustManagerFactory; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import io.grpc.ManagedChannel; import org.wso2.apk.integration.utils.GenericClientInterceptor; -import org.wso2.apk.integration.utils.clients.studentGrpcClient.StudentRequest; -import org.wso2.apk.integration.utils.clients.studentGrpcClient.StudentResponse; -import org.wso2.apk.integration.utils.clients.studentGrpcClient.StudentServiceDefaultVersionGrpc; -import org.wso2.apk.integration.utils.clients.studentGrpcClient.StudentServiceGrpc; +import org.wso2.apk.integration.utils.clients.student_service.StudentRequest; +import org.wso2.apk.integration.utils.clients.student_service.StudentResponse; +import org.wso2.apk.integration.utils.clients.student_service.StudentServiceDefaultVersionGrpc; +import org.wso2.apk.integration.utils.clients.student_service.StudentServiceGrpc; import javax.net.ssl.SSLException; import java.util.Map; diff --git a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/Student.java b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/Student.java deleted file mode 100644 index 26a383170..000000000 --- a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/Student.java +++ /dev/null @@ -1,64 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: student.proto - -package org.wso2.apk.integration.utils.clients.studentGrpcClient; - -public final class Student { - private Student() { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - - static final com.google.protobuf.Descriptors.Descriptor internal_static_dineth_grpc_v1_student_StudentRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_dineth_grpc_v1_student_StudentRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor internal_static_dineth_grpc_v1_student_StudentResponse_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_dineth_grpc_v1_student_StudentResponse_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - static { - String[] descriptorData = { - "\n\rstudent.proto\022\026dineth.grpc.v1.student\"" + - "\034\n\016StudentRequest\022\n\n\002id\030\003 \001(\005\",\n\017Student" + - "Response\022\014\n\004name\030\001 \001(\t\022\013\n\003age\030\002 \001(\0052\266\003\n\016" + - "StudentService\022_\n\nGetStudent\022&.dineth.gr" + - "pc.v1.student.StudentRequest\032\'.dineth.gr" + - "pc.v1.student.StudentResponse\"\000\022g\n\020GetSt" + - "udentStream\022&.dineth.grpc.v1.student.Stu" + - "dentRequest\032\'.dineth.grpc.v1.student.Stu" + - "dentResponse\"\0000\001\022h\n\021SendStudentStream\022&." + - "dineth.grpc.v1.student.StudentRequest\032\'." + - "dineth.grpc.v1.student.StudentResponse\"\000" + - "(\001\022p\n\027SendAndGetStudentStream\022&.dineth.g" + - "rpc.v1.student.StudentRequest\032\'.dineth.g" + - "rpc.v1.student.StudentResponse\"\000(\0010\001B<\n8" + - "org.wso2.apk.integration.utils.clients.s" + - "tudentGrpcClientP\001b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_dineth_grpc_v1_student_StudentRequest_descriptor = getDescriptor().getMessageTypes().get(0); - internal_static_dineth_grpc_v1_student_StudentRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_dineth_grpc_v1_student_StudentRequest_descriptor, - new String[] { "Id", }); - internal_static_dineth_grpc_v1_student_StudentResponse_descriptor = getDescriptor().getMessageTypes().get(1); - internal_static_dineth_grpc_v1_student_StudentResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_dineth_grpc_v1_student_StudentResponse_descriptor, - new String[] { "Name", "Age", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} \ No newline at end of file diff --git a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentRequest.java b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentRequest.java deleted file mode 100644 index d3df33d1c..000000000 --- a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentRequest.java +++ /dev/null @@ -1,518 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: student.proto - -package org.wso2.apk.integration.utils.clients.studentGrpcClient; - -/** - * Protobuf type {@code dineth.grpc.v1.student.StudentRequest} - */ -public final class StudentRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:dineth.grpc.v1.student.StudentRequest) - StudentRequestOrBuilder { - private static final long serialVersionUID = 0L; - - // Use StudentRequest.newBuilder() to construct. - private StudentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private StudentRequest() { - } - - @Override - @SuppressWarnings({ "unused" }) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new StudentRequest(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private StudentRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 24: { - - id_ = input.readInt32(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return Student.internal_static_dineth_grpc_v1_student_StudentRequest_descriptor; - } - - @Override - protected FieldAccessorTable internalGetFieldAccessorTable() { - return Student.internal_static_dineth_grpc_v1_student_StudentRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - StudentRequest.class, Builder.class); - } - - public static final int ID_FIELD_NUMBER = 3; - private int id_; - - /** - * int32 id = 3; - * - * @return The id. - */ - @Override - public int getId() { - return id_; - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) - return true; - if (isInitialized == 0) - return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (id_ != 0) { - output.writeInt32(3, id_); - } - unknownFields.writeTo(output); - } - - @Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) - return size; - - size = 0; - if (id_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, id_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof StudentRequest)) { - return super.equals(obj); - } - StudentRequest other = (StudentRequest) obj; - - if (getId() != other.getId()) - return false; - if (!unknownFields.equals(other.unknownFields)) - return false; - return true; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static StudentRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static StudentRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static StudentRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static StudentRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static StudentRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static StudentRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static StudentRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static StudentRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static StudentRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static StudentRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static StudentRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static StudentRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(StudentRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() - : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code dineth.grpc.v1.student.StudentRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:dineth.grpc.v1.student.StudentRequest) - StudentRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return Student.internal_static_dineth_grpc_v1_student_StudentRequest_descriptor; - } - - @Override - protected FieldAccessorTable internalGetFieldAccessorTable() { - return Student.internal_static_dineth_grpc_v1_student_StudentRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - StudentRequest.class, Builder.class); - } - - // Construct using - // org.wso2.apk.integration.utils.clients.studentGrpcClient.StudentRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - } - } - - @Override - public Builder clear() { - super.clear(); - id_ = 0; - - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return Student.internal_static_dineth_grpc_v1_student_StudentRequest_descriptor; - } - - @Override - public StudentRequest getDefaultInstanceForType() { - return StudentRequest.getDefaultInstance(); - } - - @Override - public StudentRequest build() { - StudentRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public StudentRequest buildPartial() { - StudentRequest result = new StudentRequest(this); - result.id_ = id_; - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof StudentRequest) { - return mergeFrom((StudentRequest) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(StudentRequest other) { - if (other == StudentRequest.getDefaultInstance()) - return this; - if (other.getId() != 0) { - setId(other.getId()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - StudentRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (StudentRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int id_; - - /** - * int32 id = 3; - * - * @return The id. - */ - @Override - public int getId() { - return id_; - } - - /** - * int32 id = 3; - * - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId(int value) { - - id_ = value; - onChanged(); - return this; - } - - /** - * int32 id = 3; - * - * @return This builder for chaining. - */ - public Builder clearId() { - - id_ = 0; - onChanged(); - return this; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:dineth.grpc.v1.student.StudentRequest) - } - - // @@protoc_insertion_point(class_scope:dineth.grpc.v1.student.StudentRequest) - private static final StudentRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new StudentRequest(); - } - - public static StudentRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - @Override - public StudentRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StudentRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public StudentRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} diff --git a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentRequestOrBuilder.java b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentRequestOrBuilder.java deleted file mode 100644 index e7beaba18..000000000 --- a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentRequestOrBuilder.java +++ /dev/null @@ -1,16 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: student.proto - -package org.wso2.apk.integration.utils.clients.studentGrpcClient; - -public interface StudentRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:dineth.grpc.v1.student.StudentRequest) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 id = 3; - * - * @return The id. - */ - int getId(); -} \ No newline at end of file diff --git a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentResponse.java b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentResponse.java deleted file mode 100644 index af974ffa3..000000000 --- a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentResponse.java +++ /dev/null @@ -1,665 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: student.proto - -package org.wso2.apk.integration.utils.clients.studentGrpcClient; - -/** - * Protobuf type {@code dineth.grpc.v1.student.StudentResponse} - */ -public final class StudentResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:dineth.grpc.v1.student.StudentResponse) - StudentResponseOrBuilder { - private static final long serialVersionUID = 0L; - - // Use StudentResponse.newBuilder() to construct. - private StudentResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private StudentResponse() { - name_ = ""; - } - - @Override - @SuppressWarnings({ "unused" }) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new StudentResponse(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private StudentResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 16: { - - age_ = input.readInt32(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return Student.internal_static_dineth_grpc_v1_student_StudentResponse_descriptor; - } - - @Override - protected FieldAccessorTable internalGetFieldAccessorTable() { - return Student.internal_static_dineth_grpc_v1_student_StudentResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - StudentResponse.class, Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile Object name_; - - /** - * string name = 1; - * - * @return The name. - */ - @Override - public String getName() { - Object ref = name_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - - /** - * string name = 1; - * - * @return The bytes for name. - */ - @Override - public com.google.protobuf.ByteString getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int AGE_FIELD_NUMBER = 2; - private int age_; - - /** - * int32 age = 2; - * - * @return The age. - */ - @Override - public int getAge() { - return age_; - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) - return true; - if (isInitialized == 0) - return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (age_ != 0) { - output.writeInt32(2, age_); - } - unknownFields.writeTo(output); - } - - @Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) - return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (age_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, age_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof StudentResponse)) { - return super.equals(obj); - } - StudentResponse other = (StudentResponse) obj; - - if (!getName() - .equals(other.getName())) - return false; - if (getAge() != other.getAge()) - return false; - if (!unknownFields.equals(other.unknownFields)) - return false; - return true; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + AGE_FIELD_NUMBER; - hash = (53 * hash) + getAge(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static StudentResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static StudentResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static StudentResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static StudentResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static StudentResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static StudentResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static StudentResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static StudentResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static StudentResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static StudentResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static StudentResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static StudentResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(StudentResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() - : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code dineth.grpc.v1.student.StudentResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:dineth.grpc.v1.student.StudentResponse) - StudentResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return Student.internal_static_dineth_grpc_v1_student_StudentResponse_descriptor; - } - - @Override - protected FieldAccessorTable internalGetFieldAccessorTable() { - return Student.internal_static_dineth_grpc_v1_student_StudentResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - StudentResponse.class, Builder.class); - } - - // Construct using - // org.wso2.apk.integration.utils.clients.studentGrpcClient.StudentResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - } - } - - @Override - public Builder clear() { - super.clear(); - name_ = ""; - - age_ = 0; - - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return Student.internal_static_dineth_grpc_v1_student_StudentResponse_descriptor; - } - - @Override - public StudentResponse getDefaultInstanceForType() { - return StudentResponse.getDefaultInstance(); - } - - @Override - public StudentResponse build() { - StudentResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public StudentResponse buildPartial() { - StudentResponse result = new StudentResponse(this); - result.name_ = name_; - result.age_ = age_; - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof StudentResponse) { - return mergeFrom((StudentResponse) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(StudentResponse other) { - if (other == StudentResponse.getDefaultInstance()) - return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getAge() != 0) { - setAge(other.getAge()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - StudentResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (StudentResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private Object name_ = ""; - - /** - * string name = 1; - * - * @return The name. - */ - public String getName() { - Object ref = name_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - * string name = 1; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - * string name = 1; - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - - /** - * string name = 1; - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - - /** - * string name = 1; - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private int age_; - - /** - * int32 age = 2; - * - * @return The age. - */ - @Override - public int getAge() { - return age_; - } - - /** - * int32 age = 2; - * - * @param value The age to set. - * @return This builder for chaining. - */ - public Builder setAge(int value) { - - age_ = value; - onChanged(); - return this; - } - - /** - * int32 age = 2; - * - * @return This builder for chaining. - */ - public Builder clearAge() { - - age_ = 0; - onChanged(); - return this; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - // @@protoc_insertion_point(builder_scope:dineth.grpc.v1.student.StudentResponse) - } - - // @@protoc_insertion_point(class_scope:dineth.grpc.v1.student.StudentResponse) - private static final StudentResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new StudentResponse(); - } - - public static StudentResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - @Override - public StudentResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StudentResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public StudentResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} diff --git a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentResponseOrBuilder.java b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentResponseOrBuilder.java deleted file mode 100644 index ffb501c68..000000000 --- a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentResponseOrBuilder.java +++ /dev/null @@ -1,30 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: student.proto - -package org.wso2.apk.integration.utils.clients.studentGrpcClient; - -public interface StudentResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:dineth.grpc.v1.student.StudentResponse) - com.google.protobuf.MessageOrBuilder { - - /** - * string name = 1; - * - * @return The name. - */ - String getName(); - - /** - * string name = 1; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); - - /** - * int32 age = 2; - * - * @return The age. - */ - int getAge(); -} \ No newline at end of file diff --git a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentServiceDefaultVersionGrpc.java b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentServiceDefaultVersionGrpc.java deleted file mode 100644 index 52b7ed799..000000000 --- a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentServiceDefaultVersionGrpc.java +++ /dev/null @@ -1,435 +0,0 @@ -package org.wso2.apk.integration.utils.clients.studentGrpcClient; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - */ -@javax.annotation.Generated(value = "by gRPC proto compiler (version 1.39.0)", comments = "Source: student.proto") -public final class StudentServiceDefaultVersionGrpc { - - private StudentServiceDefaultVersionGrpc() { - } - - public static final String SERVICE_NAME = "dineth.grpc.api.student.StudentService"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getGetStudentMethod; - - @io.grpc.stub.annotations.RpcMethod(fullMethodName = SERVICE_NAME + '/' - + "GetStudent", requestType = StudentRequest.class, responseType = StudentResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetStudentMethod() { - io.grpc.MethodDescriptor getGetStudentMethod; - if ((getGetStudentMethod = StudentServiceDefaultVersionGrpc.getGetStudentMethod) == null) { - synchronized (StudentServiceDefaultVersionGrpc.class) { - if ((getGetStudentMethod = StudentServiceDefaultVersionGrpc.getGetStudentMethod) == null) { - StudentServiceDefaultVersionGrpc.getGetStudentMethod = getGetStudentMethod = io.grpc.MethodDescriptor - .newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetStudent")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - StudentRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - StudentResponse.getDefaultInstance())) - .setSchemaDescriptor(new StudentServiceMethodDescriptorSupplier("GetStudent")) - .build(); - } - } - } - return getGetStudentMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetStudentStreamMethod; - - @io.grpc.stub.annotations.RpcMethod(fullMethodName = SERVICE_NAME + '/' - + "GetStudentStream", requestType = StudentRequest.class, responseType = StudentResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) - public static io.grpc.MethodDescriptor getGetStudentStreamMethod() { - io.grpc.MethodDescriptor getGetStudentStreamMethod; - if ((getGetStudentStreamMethod = StudentServiceDefaultVersionGrpc.getGetStudentStreamMethod) == null) { - synchronized (StudentServiceDefaultVersionGrpc.class) { - if ((getGetStudentStreamMethod = StudentServiceDefaultVersionGrpc.getGetStudentStreamMethod) == null) { - StudentServiceDefaultVersionGrpc.getGetStudentStreamMethod = getGetStudentStreamMethod = io.grpc.MethodDescriptor - .newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetStudentStream")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - StudentRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - StudentResponse.getDefaultInstance())) - .setSchemaDescriptor(new StudentServiceMethodDescriptorSupplier("GetStudentStream")) - .build(); - } - } - } - return getGetStudentStreamMethod; - } - - private static volatile io.grpc.MethodDescriptor getSendStudentStreamMethod; - - @io.grpc.stub.annotations.RpcMethod(fullMethodName = SERVICE_NAME + '/' - + "SendStudentStream", requestType = StudentRequest.class, responseType = StudentResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) - public static io.grpc.MethodDescriptor getSendStudentStreamMethod() { - io.grpc.MethodDescriptor getSendStudentStreamMethod; - if ((getSendStudentStreamMethod = StudentServiceDefaultVersionGrpc.getSendStudentStreamMethod) == null) { - synchronized (StudentServiceDefaultVersionGrpc.class) { - if ((getSendStudentStreamMethod = StudentServiceDefaultVersionGrpc.getSendStudentStreamMethod) == null) { - StudentServiceDefaultVersionGrpc.getSendStudentStreamMethod = getSendStudentStreamMethod = io.grpc.MethodDescriptor - .newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SendStudentStream")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - StudentRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - StudentResponse.getDefaultInstance())) - .setSchemaDescriptor(new StudentServiceMethodDescriptorSupplier("SendStudentStream")) - .build(); - } - } - } - return getSendStudentStreamMethod; - } - - private static volatile io.grpc.MethodDescriptor getSendAndGetStudentStreamMethod; - - @io.grpc.stub.annotations.RpcMethod(fullMethodName = SERVICE_NAME + '/' - + "SendAndGetStudentStream", requestType = StudentRequest.class, responseType = StudentResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - public static io.grpc.MethodDescriptor getSendAndGetStudentStreamMethod() { - io.grpc.MethodDescriptor getSendAndGetStudentStreamMethod; - if ((getSendAndGetStudentStreamMethod = StudentServiceDefaultVersionGrpc.getSendAndGetStudentStreamMethod) == null) { - synchronized (StudentServiceDefaultVersionGrpc.class) { - if ((getSendAndGetStudentStreamMethod = StudentServiceDefaultVersionGrpc.getSendAndGetStudentStreamMethod) == null) { - StudentServiceDefaultVersionGrpc.getSendAndGetStudentStreamMethod = getSendAndGetStudentStreamMethod = io.grpc.MethodDescriptor - .newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SendAndGetStudentStream")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - StudentRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - StudentResponse.getDefaultInstance())) - .setSchemaDescriptor(new StudentServiceMethodDescriptorSupplier("SendAndGetStudentStream")) - .build(); - } - } - } - return getSendAndGetStudentStreamMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static StudentServiceStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = new io.grpc.stub.AbstractStub.StubFactory() { - @Override - public StudentServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new StudentServiceStub(channel, callOptions); - } - }; - return StudentServiceStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output - * calls on the service - */ - public static StudentServiceBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = new io.grpc.stub.AbstractStub.StubFactory() { - @Override - public StudentServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new StudentServiceBlockingStub(channel, callOptions); - } - }; - return StudentServiceBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the - * service - */ - public static StudentServiceFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = new io.grpc.stub.AbstractStub.StubFactory() { - @Override - public StudentServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new StudentServiceFutureStub(channel, callOptions); - } - }; - return StudentServiceFutureStub.newStub(factory, channel); - } - - /** - */ - public static abstract class StudentServiceImplBase implements io.grpc.BindableService { - - /** - */ - public void getStudent(StudentRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetStudentMethod(), responseObserver); - } - - /** - */ - public void getStudentStream(StudentRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetStudentStreamMethod(), responseObserver); - } - - /** - */ - public io.grpc.stub.StreamObserver sendStudentStream( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getSendStudentStreamMethod(), - responseObserver); - } - - /** - */ - public io.grpc.stub.StreamObserver sendAndGetStudentStream( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getSendAndGetStudentStreamMethod(), - responseObserver); - } - - @Override - public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getGetStudentMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers( - this, METHODID_GET_STUDENT))) - .addMethod( - getGetStudentStreamMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers( - this, METHODID_GET_STUDENT_STREAM))) - .addMethod( - getSendStudentStreamMethod(), - io.grpc.stub.ServerCalls.asyncClientStreamingCall( - new MethodHandlers( - this, METHODID_SEND_STUDENT_STREAM))) - .addMethod( - getSendAndGetStudentStreamMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers( - this, METHODID_SEND_AND_GET_STUDENT_STREAM))) - .build(); - } - } - - /** - */ - public static final class StudentServiceStub extends io.grpc.stub.AbstractAsyncStub { - private StudentServiceStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @Override - protected StudentServiceStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new StudentServiceStub(channel, callOptions); - } - - /** - */ - public void getStudent(StudentRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetStudentMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public void getStudentStream(StudentRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncServerStreamingCall( - getChannel().newCall(getGetStudentStreamMethod(), getCallOptions()), request, responseObserver); - } - - /** - */ - public io.grpc.stub.StreamObserver sendStudentStream( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ClientCalls.asyncClientStreamingCall( - getChannel().newCall(getSendStudentStreamMethod(), getCallOptions()), responseObserver); - } - - /** - */ - public io.grpc.stub.StreamObserver sendAndGetStudentStream( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( - getChannel().newCall(getSendAndGetStudentStreamMethod(), getCallOptions()), responseObserver); - } - } - - /** - */ - public static final class StudentServiceBlockingStub - extends io.grpc.stub.AbstractBlockingStub { - private StudentServiceBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @Override - protected StudentServiceBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new StudentServiceBlockingStub(channel, callOptions); - } - - /** - */ - public StudentResponse getStudent(StudentRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetStudentMethod(), getCallOptions(), request); - } - - /** - */ - public java.util.Iterator getStudentStream( - StudentRequest request) { - return io.grpc.stub.ClientCalls.blockingServerStreamingCall( - getChannel(), getGetStudentStreamMethod(), getCallOptions(), request); - } - } - - /** - */ - public static final class StudentServiceFutureStub - extends io.grpc.stub.AbstractFutureStub { - private StudentServiceFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @Override - protected StudentServiceFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new StudentServiceFutureStub(channel, callOptions); - } - - /** - */ - public com.google.common.util.concurrent.ListenableFuture getStudent( - StudentRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetStudentMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_GET_STUDENT = 0; - private static final int METHODID_GET_STUDENT_STREAM = 1; - private static final int METHODID_SEND_STUDENT_STREAM = 2; - private static final int METHODID_SEND_AND_GET_STUDENT_STREAM = 3; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final StudentServiceImplBase serviceImpl; - private final int methodId; - - MethodHandlers(StudentServiceImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @Override - @SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_GET_STUDENT: - serviceImpl.getStudent((StudentRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_STUDENT_STREAM: - serviceImpl.getStudentStream((StudentRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @Override - @SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_SEND_STUDENT_STREAM: - return (io.grpc.stub.StreamObserver) serviceImpl.sendStudentStream( - (io.grpc.stub.StreamObserver) responseObserver); - case METHODID_SEND_AND_GET_STUDENT_STREAM: - return (io.grpc.stub.StreamObserver) serviceImpl.sendAndGetStudentStream( - (io.grpc.stub.StreamObserver) responseObserver); - default: - throw new AssertionError(); - } - } - } - - private static abstract class StudentServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - StudentServiceBaseDescriptorSupplier() { - } - - @Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return Student.getDescriptor(); - } - - @Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("StudentService"); - } - } - - private static final class StudentServiceFileDescriptorSupplier - extends StudentServiceBaseDescriptorSupplier { - StudentServiceFileDescriptorSupplier() { - } - } - - private static final class StudentServiceMethodDescriptorSupplier - extends StudentServiceBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - StudentServiceMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (StudentServiceDefaultVersionGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new StudentServiceFileDescriptorSupplier()) - .addMethod(getGetStudentMethod()) - .addMethod(getGetStudentStreamMethod()) - .addMethod(getSendStudentStreamMethod()) - .addMethod(getSendAndGetStudentStreamMethod()) - .build(); - } - } - } - return result; - } -} \ No newline at end of file diff --git a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/Student.java b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/Student.java new file mode 100644 index 000000000..7344559a7 --- /dev/null +++ b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/Student.java @@ -0,0 +1,77 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: student.proto +// Protobuf Java Version: 4.28.0 + +package org.wso2.apk.integration.utils.clients.student_service; + +public final class Student { + private Student() { + } + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 0, + /* suffix= */ "", + Student.class.getName()); + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor internal_static_org_apk_v1_student_service_StudentRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_org_apk_v1_student_service_StudentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor internal_static_org_apk_v1_student_service_StudentResponse_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_org_apk_v1_student_service_StudentResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + static { + java.lang.String[] descriptorData = { + "\n\rstudent.proto\022\032org.apk.v1.student_serv" + + "ice\"\034\n\016StudentRequest\022\n\n\002id\030\003 \001(\005\",\n\017Stu" + + "dentResponse\022\014\n\004name\030\001 \001(\t\022\013\n\003age\030\002 \001(\0052" + + "\326\003\n\016StudentService\022g\n\nGetStudent\022*.org.a" + + "pk.v1.student_service.StudentRequest\032+.o" + + "rg.apk.v1.student_service.StudentRespons" + + "e\"\000\022o\n\020GetStudentStream\022*.org.apk.v1.stu" + + "dent_service.StudentRequest\032+.org.apk.v1" + + ".student_service.StudentResponse\"\0000\001\022p\n\021" + + "SendStudentStream\022*.org.apk.v1.student_s" + + "ervice.StudentRequest\032+.org.apk.v1.stude" + + "nt_service.StudentResponse\"\000(\001\022x\n\027SendAn" + + "dGetStudentStream\022*.org.apk.v1.student_s" + + "ervice.StudentRequest\032+.org.apk.v1.stude" + + "nt_service.StudentResponse\"\000(\0010\001B\036\n\032org." + + "apk.v1.student_serviceP\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_org_apk_v1_student_service_StudentRequest_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_org_apk_v1_student_service_StudentRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_apk_v1_student_service_StudentRequest_descriptor, + new java.lang.String[] { "Id", }); + internal_static_org_apk_v1_student_service_StudentResponse_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_org_apk_v1_student_service_StudentResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_org_apk_v1_student_service_StudentResponse_descriptor, + new java.lang.String[] { "Name", "Age", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentRequest.java b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentRequest.java new file mode 100644 index 000000000..82c231d41 --- /dev/null +++ b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentRequest.java @@ -0,0 +1,465 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: student.proto +// Protobuf Java Version: 4.28.0 + +package org.wso2.apk.integration.utils.clients.student_service; + +/** + * Protobuf type {@code org.apk.v1.student_service.StudentRequest} + */ +public final class StudentRequest extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:org.apk.v1.student_service.StudentRequest) + StudentRequestOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 0, + /* suffix= */ "", + StudentRequest.class.getName()); + } + + // Use StudentRequest.newBuilder() to construct. + private StudentRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private StudentRequest() { + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return org.wso2.apk.integration.utils.clients.student_service.Student.internal_static_org_apk_v1_student_service_StudentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return org.wso2.apk.integration.utils.clients.student_service.Student.internal_static_org_apk_v1_student_service_StudentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.wso2.apk.integration.utils.clients.student_service.StudentRequest.class, + org.wso2.apk.integration.utils.clients.student_service.StudentRequest.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 3; + private int id_ = 0; + + /** + * int32 id = 3; + * + * @return The id. + */ + @java.lang.Override + public int getId() { + return id_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) + return true; + if (isInitialized == 0) + return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (id_ != 0) { + output.writeInt32(3, id_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) + return size; + + size = 0; + if (id_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, id_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.wso2.apk.integration.utils.clients.student_service.StudentRequest)) { + return super.equals(obj); + } + org.wso2.apk.integration.utils.clients.student_service.StudentRequest other = (org.wso2.apk.integration.utils.clients.student_service.StudentRequest) obj; + + if (getId() != other.getId()) + return false; + if (!getUnknownFields().equals(other.getUnknownFields())) + return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentRequest parseFrom( + java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentRequest parseDelimitedFrom( + java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(org.wso2.apk.integration.utils.clients.student_service.StudentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() + : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code org.apk.v1.student_service.StudentRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:org.apk.v1.student_service.StudentRequest) + org.wso2.apk.integration.utils.clients.student_service.StudentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return org.wso2.apk.integration.utils.clients.student_service.Student.internal_static_org_apk_v1_student_service_StudentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return org.wso2.apk.integration.utils.clients.student_service.Student.internal_static_org_apk_v1_student_service_StudentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.wso2.apk.integration.utils.clients.student_service.StudentRequest.class, + org.wso2.apk.integration.utils.clients.student_service.StudentRequest.Builder.class); + } + + // Construct using org.apk.v1.student_service.StudentRequest.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return org.wso2.apk.integration.utils.clients.student_service.Student.internal_static_org_apk_v1_student_service_StudentRequest_descriptor; + } + + @java.lang.Override + public org.wso2.apk.integration.utils.clients.student_service.StudentRequest getDefaultInstanceForType() { + return org.wso2.apk.integration.utils.clients.student_service.StudentRequest.getDefaultInstance(); + } + + @java.lang.Override + public org.wso2.apk.integration.utils.clients.student_service.StudentRequest build() { + org.wso2.apk.integration.utils.clients.student_service.StudentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.wso2.apk.integration.utils.clients.student_service.StudentRequest buildPartial() { + org.wso2.apk.integration.utils.clients.student_service.StudentRequest result = new org.wso2.apk.integration.utils.clients.student_service.StudentRequest( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(org.wso2.apk.integration.utils.clients.student_service.StudentRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.wso2.apk.integration.utils.clients.student_service.StudentRequest) { + return mergeFrom((org.wso2.apk.integration.utils.clients.student_service.StudentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.wso2.apk.integration.utils.clients.student_service.StudentRequest other) { + if (other == org.wso2.apk.integration.utils.clients.student_service.StudentRequest.getDefaultInstance()) + return this; + if (other.getId() != 0) { + setId(other.getId()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 24: { + id_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 24 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int id_; + + /** + * int32 id = 3; + * + * @return The id. + */ + @java.lang.Override + public int getId() { + return id_; + } + + /** + * int32 id = 3; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(int value) { + + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * int32 id = 3; + * + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:org.apk.v1.student_service.StudentRequest) + } + + // @@protoc_insertion_point(class_scope:org.apk.v1.student_service.StudentRequest) + private static final org.wso2.apk.integration.utils.clients.student_service.StudentRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.wso2.apk.integration.utils.clients.student_service.StudentRequest(); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StudentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public org.wso2.apk.integration.utils.clients.student_service.StudentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} diff --git a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentRequestOrBuilder.java b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentRequestOrBuilder.java new file mode 100644 index 000000000..43b6d6c45 --- /dev/null +++ b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentRequestOrBuilder.java @@ -0,0 +1,18 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: student.proto +// Protobuf Java Version: 4.28.0 + +package org.wso2.apk.integration.utils.clients.student_service; + +public interface StudentRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.apk.v1.student_service.StudentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 id = 3; + * + * @return The id. + */ + int getId(); +} diff --git a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentResponse.java b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentResponse.java new file mode 100644 index 000000000..d5760eda6 --- /dev/null +++ b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentResponse.java @@ -0,0 +1,614 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: student.proto +// Protobuf Java Version: 4.28.0 + +package org.wso2.apk.integration.utils.clients.student_service; + +/** + * Protobuf type {@code org.apk.v1.student_service.StudentResponse} + */ +public final class StudentResponse extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:org.apk.v1.student_service.StudentResponse) + StudentResponseOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 0, + /* suffix= */ "", + StudentResponse.class.getName()); + } + + // Use StudentResponse.newBuilder() to construct. + private StudentResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private StudentResponse() { + name_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return org.wso2.apk.integration.utils.clients.student_service.Student.internal_static_org_apk_v1_student_service_StudentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return org.wso2.apk.integration.utils.clients.student_service.Student.internal_static_org_apk_v1_student_service_StudentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.wso2.apk.integration.utils.clients.student_service.StudentResponse.class, + org.wso2.apk.integration.utils.clients.student_service.StudentResponse.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AGE_FIELD_NUMBER = 2; + private int age_ = 0; + + /** + * int32 age = 2; + * + * @return The age. + */ + @java.lang.Override + public int getAge() { + return age_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) + return true; + if (isInitialized == 0) + return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (age_ != 0) { + output.writeInt32(2, age_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) + return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (age_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, age_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof org.wso2.apk.integration.utils.clients.student_service.StudentResponse)) { + return super.equals(obj); + } + org.wso2.apk.integration.utils.clients.student_service.StudentResponse other = (org.wso2.apk.integration.utils.clients.student_service.StudentResponse) obj; + + if (!getName() + .equals(other.getName())) + return false; + if (getAge() != other.getAge()) + return false; + if (!getUnknownFields().equals(other.getUnknownFields())) + return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + AGE_FIELD_NUMBER; + hash = (53 * hash) + getAge(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentResponse parseFrom( + java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentResponse parseDelimitedFrom( + java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(org.wso2.apk.integration.utils.clients.student_service.StudentResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() + : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * Protobuf type {@code org.apk.v1.student_service.StudentResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:org.apk.v1.student_service.StudentResponse) + org.wso2.apk.integration.utils.clients.student_service.StudentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return org.wso2.apk.integration.utils.clients.student_service.Student.internal_static_org_apk_v1_student_service_StudentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { + return org.wso2.apk.integration.utils.clients.student_service.Student.internal_static_org_apk_v1_student_service_StudentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.wso2.apk.integration.utils.clients.student_service.StudentResponse.class, + org.wso2.apk.integration.utils.clients.student_service.StudentResponse.Builder.class); + } + + // Construct using org.apk.v1.student_service.StudentResponse.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + age_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return org.wso2.apk.integration.utils.clients.student_service.Student.internal_static_org_apk_v1_student_service_StudentResponse_descriptor; + } + + @java.lang.Override + public org.wso2.apk.integration.utils.clients.student_service.StudentResponse getDefaultInstanceForType() { + return org.wso2.apk.integration.utils.clients.student_service.StudentResponse.getDefaultInstance(); + } + + @java.lang.Override + public org.wso2.apk.integration.utils.clients.student_service.StudentResponse build() { + org.wso2.apk.integration.utils.clients.student_service.StudentResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public org.wso2.apk.integration.utils.clients.student_service.StudentResponse buildPartial() { + org.wso2.apk.integration.utils.clients.student_service.StudentResponse result = new org.wso2.apk.integration.utils.clients.student_service.StudentResponse( + this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(org.wso2.apk.integration.utils.clients.student_service.StudentResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.age_ = age_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.wso2.apk.integration.utils.clients.student_service.StudentResponse) { + return mergeFrom((org.wso2.apk.integration.utils.clients.student_service.StudentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.wso2.apk.integration.utils.clients.student_service.StudentResponse other) { + if (other == org.wso2.apk.integration.utils.clients.student_service.StudentResponse.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getAge() != 0) { + setAge(other.getAge()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: { + age_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int age_; + + /** + * int32 age = 2; + * + * @return The age. + */ + @java.lang.Override + public int getAge() { + return age_; + } + + /** + * int32 age = 2; + * + * @param value The age to set. + * @return This builder for chaining. + */ + public Builder setAge(int value) { + + age_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * int32 age = 2; + * + * @return This builder for chaining. + */ + public Builder clearAge() { + bitField0_ = (bitField0_ & ~0x00000002); + age_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:org.apk.v1.student_service.StudentResponse) + } + + // @@protoc_insertion_point(class_scope:org.apk.v1.student_service.StudentResponse) + private static final org.wso2.apk.integration.utils.clients.student_service.StudentResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new org.wso2.apk.integration.utils.clients.student_service.StudentResponse(); + } + + public static org.wso2.apk.integration.utils.clients.student_service.StudentResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StudentResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public org.wso2.apk.integration.utils.clients.student_service.StudentResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} diff --git a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentResponseOrBuilder.java b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentResponseOrBuilder.java new file mode 100644 index 000000000..0be815019 --- /dev/null +++ b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentResponseOrBuilder.java @@ -0,0 +1,32 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: student.proto +// Protobuf Java Version: 4.28.0 + +package org.wso2.apk.integration.utils.clients.student_service; + +public interface StudentResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.apk.v1.student_service.StudentResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * int32 age = 2; + * + * @return The age. + */ + int getAge(); +} diff --git a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentServiceDefaultVersionGrpc.java b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentServiceDefaultVersionGrpc.java new file mode 100644 index 000000000..c5684c148 --- /dev/null +++ b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentServiceDefaultVersionGrpc.java @@ -0,0 +1,454 @@ +package org.wso2.apk.integration.utils.clients.student_service; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated(value = "by gRPC proto compiler (version 1.58.0)", comments = "Source: student.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class StudentServiceDefaultVersionGrpc { + + private StudentServiceDefaultVersionGrpc() { + } + + public static final java.lang.String SERVICE_NAME = "org.apk.student_service.StudentService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getGetStudentMethod; + + @io.grpc.stub.annotations.RpcMethod(fullMethodName = SERVICE_NAME + '/' + + "GetStudent", requestType = StudentRequest.class, responseType = StudentResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetStudentMethod() { + io.grpc.MethodDescriptor getGetStudentMethod; + if ((getGetStudentMethod = StudentServiceDefaultVersionGrpc.getGetStudentMethod) == null) { + synchronized (StudentServiceDefaultVersionGrpc.class) { + if ((getGetStudentMethod = StudentServiceDefaultVersionGrpc.getGetStudentMethod) == null) { + StudentServiceDefaultVersionGrpc.getGetStudentMethod = getGetStudentMethod = io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetStudent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + StudentRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + StudentResponse.getDefaultInstance())) + .setSchemaDescriptor(new StudentServiceMethodDescriptorSupplier("GetStudent")) + .build(); + } + } + } + return getGetStudentMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetStudentStreamMethod; + + @io.grpc.stub.annotations.RpcMethod(fullMethodName = SERVICE_NAME + '/' + + "GetStudentStream", requestType = StudentRequest.class, responseType = StudentResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getGetStudentStreamMethod() { + io.grpc.MethodDescriptor getGetStudentStreamMethod; + if ((getGetStudentStreamMethod = StudentServiceDefaultVersionGrpc.getGetStudentStreamMethod) == null) { + synchronized (StudentServiceDefaultVersionGrpc.class) { + if ((getGetStudentStreamMethod = StudentServiceDefaultVersionGrpc.getGetStudentStreamMethod) == null) { + StudentServiceDefaultVersionGrpc.getGetStudentStreamMethod = getGetStudentStreamMethod = io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetStudentStream")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + StudentRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + StudentResponse.getDefaultInstance())) + .setSchemaDescriptor(new StudentServiceMethodDescriptorSupplier("GetStudentStream")) + .build(); + } + } + } + return getGetStudentStreamMethod; + } + + private static volatile io.grpc.MethodDescriptor getSendStudentStreamMethod; + + @io.grpc.stub.annotations.RpcMethod(fullMethodName = SERVICE_NAME + '/' + + "SendStudentStream", requestType = StudentRequest.class, responseType = StudentResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + public static io.grpc.MethodDescriptor getSendStudentStreamMethod() { + io.grpc.MethodDescriptor getSendStudentStreamMethod; + if ((getSendStudentStreamMethod = StudentServiceDefaultVersionGrpc.getSendStudentStreamMethod) == null) { + synchronized (StudentServiceDefaultVersionGrpc.class) { + if ((getSendStudentStreamMethod = StudentServiceDefaultVersionGrpc.getSendStudentStreamMethod) == null) { + StudentServiceDefaultVersionGrpc.getSendStudentStreamMethod = getSendStudentStreamMethod = io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SendStudentStream")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + StudentRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + StudentResponse.getDefaultInstance())) + .setSchemaDescriptor(new StudentServiceMethodDescriptorSupplier("SendStudentStream")) + .build(); + } + } + } + return getSendStudentStreamMethod; + } + + private static volatile io.grpc.MethodDescriptor getSendAndGetStudentStreamMethod; + + @io.grpc.stub.annotations.RpcMethod(fullMethodName = SERVICE_NAME + '/' + + "SendAndGetStudentStream", requestType = StudentRequest.class, responseType = StudentResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor getSendAndGetStudentStreamMethod() { + io.grpc.MethodDescriptor getSendAndGetStudentStreamMethod; + if ((getSendAndGetStudentStreamMethod = StudentServiceDefaultVersionGrpc.getSendAndGetStudentStreamMethod) == null) { + synchronized (StudentServiceDefaultVersionGrpc.class) { + if ((getSendAndGetStudentStreamMethod = StudentServiceDefaultVersionGrpc.getSendAndGetStudentStreamMethod) == null) { + StudentServiceDefaultVersionGrpc.getSendAndGetStudentStreamMethod = getSendAndGetStudentStreamMethod = io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SendAndGetStudentStream")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + StudentRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + StudentResponse.getDefaultInstance())) + .setSchemaDescriptor(new StudentServiceMethodDescriptorSupplier("SendAndGetStudentStream")) + .build(); + } + } + } + return getSendAndGetStudentStreamMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static StudentServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public StudentServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StudentServiceStub(channel, callOptions); + } + }; + return StudentServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output + * calls on the service + */ + public static StudentServiceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public StudentServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StudentServiceBlockingStub(channel, callOptions); + } + }; + return StudentServiceBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the + * service + */ + public static StudentServiceFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public StudentServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StudentServiceFutureStub(channel, callOptions); + } + }; + return StudentServiceFutureStub.newStub(factory, channel); + } + + /** + */ + public interface AsyncService { + + /** + */ + default void getStudent(StudentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetStudentMethod(), responseObserver); + } + + /** + */ + default void getStudentStream(StudentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetStudentStreamMethod(), responseObserver); + } + + /** + */ + default io.grpc.stub.StreamObserver sendStudentStream( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getSendStudentStreamMethod(), + responseObserver); + } + + /** + */ + default io.grpc.stub.StreamObserver sendAndGetStudentStream( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getSendAndGetStudentStreamMethod(), + responseObserver); + } + } + + /** + * Base class for the server implementation of the service StudentService. + */ + public static abstract class StudentServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return StudentServiceDefaultVersionGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service + * StudentService. + */ + public static final class StudentServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private StudentServiceStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected StudentServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StudentServiceStub(channel, callOptions); + } + + /** + */ + public void getStudent(StudentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetStudentMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getStudentStream(StudentRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getGetStudentStreamMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public io.grpc.stub.StreamObserver sendStudentStream( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncClientStreamingCall( + getChannel().newCall(getSendStudentStreamMethod(), getCallOptions()), responseObserver); + } + + /** + */ + public io.grpc.stub.StreamObserver sendAndGetStudentStream( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getSendAndGetStudentStreamMethod(), getCallOptions()), responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service + * StudentService. + */ + public static final class StudentServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private StudentServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected StudentServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StudentServiceBlockingStub(channel, callOptions); + } + + /** + */ + public StudentResponse getStudent(StudentRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetStudentMethod(), getCallOptions(), request); + } + + /** + */ + public java.util.Iterator getStudentStream( + StudentRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getGetStudentStreamMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * StudentService. + */ + public static final class StudentServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private StudentServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected StudentServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StudentServiceFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getStudent( + StudentRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetStudentMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_STUDENT = 0; + private static final int METHODID_GET_STUDENT_STREAM = 1; + private static final int METHODID_SEND_STUDENT_STREAM = 2; + private static final int METHODID_SEND_AND_GET_STUDENT_STREAM = 3; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_STUDENT: + serviceImpl.getStudent((StudentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_STUDENT_STREAM: + serviceImpl.getStudentStream((StudentRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_SEND_STUDENT_STREAM: + return (io.grpc.stub.StreamObserver) serviceImpl.sendStudentStream( + (io.grpc.stub.StreamObserver) responseObserver); + case METHODID_SEND_AND_GET_STUDENT_STREAM: + return (io.grpc.stub.StreamObserver) serviceImpl.sendAndGetStudentStream( + (io.grpc.stub.StreamObserver) responseObserver); + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetStudentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers( + service, METHODID_GET_STUDENT))) + .addMethod( + getGetStudentStreamMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers( + service, METHODID_GET_STUDENT_STREAM))) + .addMethod( + getSendStudentStreamMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers( + service, METHODID_SEND_STUDENT_STREAM))) + .addMethod( + getSendAndGetStudentStreamMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers( + service, METHODID_SEND_AND_GET_STUDENT_STREAM))) + .build(); + } + + private static abstract class StudentServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + StudentServiceBaseDescriptorSupplier() { + } + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return Student.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("StudentService"); + } + } + + private static final class StudentServiceFileDescriptorSupplier + extends StudentServiceBaseDescriptorSupplier { + StudentServiceFileDescriptorSupplier() { + } + } + + private static final class StudentServiceMethodDescriptorSupplier + extends StudentServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + StudentServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (StudentServiceDefaultVersionGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new StudentServiceFileDescriptorSupplier()) + .addMethod(getGetStudentMethod()) + .addMethod(getGetStudentStreamMethod()) + .addMethod(getSendStudentStreamMethod()) + .addMethod(getSendAndGetStudentStreamMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentServiceGrpc.java b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentServiceGrpc.java similarity index 84% rename from test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentServiceGrpc.java rename to test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentServiceGrpc.java index 376c17a05..369affa65 100644 --- a/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/studentGrpcClient/StudentServiceGrpc.java +++ b/test/cucumber-tests/src/test/java/org/wso2/apk/integration/utils/clients/student_service/StudentServiceGrpc.java @@ -1,16 +1,17 @@ -package org.wso2.apk.integration.utils.clients.studentGrpcClient; +package org.wso2.apk.integration.utils.clients.student_service; import static io.grpc.MethodDescriptor.generateFullMethodName; /** */ -@javax.annotation.Generated(value = "by gRPC proto compiler (version 1.39.0)", comments = "Source: student.proto") +@javax.annotation.Generated(value = "by gRPC proto compiler (version 1.58.0)", comments = "Source: student.proto") +@io.grpc.stub.annotations.GrpcGenerated public final class StudentServiceGrpc { private StudentServiceGrpc() { } - public static final String SERVICE_NAME = "dineth.grpc.api.v1.student.StudentService"; + public static final java.lang.String SERVICE_NAME = "org.apk.v1.student_service.StudentService"; // Static method descriptors that strictly reflect the proto. private static volatile io.grpc.MethodDescriptor getGetStudentMethod; @@ -122,7 +123,7 @@ public static io.grpc.MethodDescriptor getSendA */ public static StudentServiceStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = new io.grpc.stub.AbstractStub.StubFactory() { - @Override + @java.lang.Override public StudentServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new StudentServiceStub(channel, callOptions); } @@ -137,7 +138,7 @@ public StudentServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions c public static StudentServiceBlockingStub newBlockingStub( io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = new io.grpc.stub.AbstractStub.StubFactory() { - @Override + @java.lang.Override public StudentServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new StudentServiceBlockingStub(channel, callOptions); } @@ -152,7 +153,7 @@ public StudentServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallO public static StudentServiceFutureStub newFutureStub( io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = new io.grpc.stub.AbstractStub.StubFactory() { - @Override + @java.lang.Override public StudentServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new StudentServiceFutureStub(channel, callOptions); } @@ -162,25 +163,25 @@ public StudentServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOpt /** */ - public static abstract class StudentServiceImplBase implements io.grpc.BindableService { + public interface AsyncService { /** */ - public void getStudent(StudentRequest request, + default void getStudent(StudentRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetStudentMethod(), responseObserver); } /** */ - public void getStudentStream(StudentRequest request, + default void getStudentStream(StudentRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetStudentStreamMethod(), responseObserver); } /** */ - public io.grpc.stub.StreamObserver sendStudentStream( + default io.grpc.stub.StreamObserver sendStudentStream( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getSendStudentStreamMethod(), responseObserver); @@ -188,48 +189,37 @@ public io.grpc.stub.StreamObserver sendStudentStream( /** */ - public io.grpc.stub.StreamObserver sendAndGetStudentStream( + default io.grpc.stub.StreamObserver sendAndGetStudentStream( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getSendAndGetStudentStreamMethod(), responseObserver); } + } - @Override + /** + * Base class for the server implementation of the service StudentService. + */ + public static abstract class StudentServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getGetStudentMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers( - this, METHODID_GET_STUDENT))) - .addMethod( - getGetStudentStreamMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers( - this, METHODID_GET_STUDENT_STREAM))) - .addMethod( - getSendStudentStreamMethod(), - io.grpc.stub.ServerCalls.asyncClientStreamingCall( - new MethodHandlers( - this, METHODID_SEND_STUDENT_STREAM))) - .addMethod( - getSendAndGetStudentStreamMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers( - this, METHODID_SEND_AND_GET_STUDENT_STREAM))) - .build(); + return StudentServiceGrpc.bindService(this); } } /** + * A stub to allow clients to do asynchronous rpc calls to service + * StudentService. */ - public static final class StudentServiceStub extends io.grpc.stub.AbstractAsyncStub { + public static final class StudentServiceStub + extends io.grpc.stub.AbstractAsyncStub { private StudentServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } - @Override + @java.lang.Override protected StudentServiceStub build( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new StudentServiceStub(channel, callOptions); @@ -269,6 +259,8 @@ public io.grpc.stub.StreamObserver sendAndGetStudentStream( } /** + * A stub to allow clients to do synchronous rpc calls to service + * StudentService. */ public static final class StudentServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { @@ -277,7 +269,7 @@ private StudentServiceBlockingStub( super(channel, callOptions); } - @Override + @java.lang.Override protected StudentServiceBlockingStub build( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new StudentServiceBlockingStub(channel, callOptions); @@ -300,6 +292,8 @@ public java.util.Iterator getStudentStream( } /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * StudentService. */ public static final class StudentServiceFutureStub extends io.grpc.stub.AbstractFutureStub { @@ -308,7 +302,7 @@ private StudentServiceFutureStub( super(channel, callOptions); } - @Override + @java.lang.Override protected StudentServiceFutureStub build( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new StudentServiceFutureStub(channel, callOptions); @@ -333,16 +327,16 @@ private static final class MethodHandlers implements io.grpc.stub.ServerCalls.ServerStreamingMethod, io.grpc.stub.ServerCalls.ClientStreamingMethod, io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final StudentServiceImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(StudentServiceImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } - @Override - @SuppressWarnings("unchecked") + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { case METHODID_GET_STUDENT: @@ -358,8 +352,8 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv } } - @Override - @SuppressWarnings("unchecked") + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") public io.grpc.stub.StreamObserver invoke( io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { @@ -375,17 +369,42 @@ public io.grpc.stub.StreamObserver invoke( } } + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetStudentMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers( + service, METHODID_GET_STUDENT))) + .addMethod( + getGetStudentStreamMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers( + service, METHODID_GET_STUDENT_STREAM))) + .addMethod( + getSendStudentStreamMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers( + service, METHODID_SEND_STUDENT_STREAM))) + .addMethod( + getSendAndGetStudentStreamMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers( + service, METHODID_SEND_AND_GET_STUDENT_STREAM))) + .build(); + } + private static abstract class StudentServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { StudentServiceBaseDescriptorSupplier() { } - @Override + @java.lang.Override public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { return Student.getDescriptor(); } - @Override + @java.lang.Override public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { return getFileDescriptor().findServiceByName("StudentService"); } @@ -400,13 +419,13 @@ private static final class StudentServiceFileDescriptorSupplier private static final class StudentServiceMethodDescriptorSupplier extends StudentServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; + private final java.lang.String methodName; - StudentServiceMethodDescriptorSupplier(String methodName) { + StudentServiceMethodDescriptorSupplier(java.lang.String methodName) { this.methodName = methodName; } - @Override + @java.lang.Override public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { return getServiceDescriptor().findMethodByName(methodName); } @@ -432,4 +451,4 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { } return result; } -} \ No newline at end of file +} diff --git a/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/generated-grpc.apk-conf b/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/generated-grpc.apk-conf index be0a39322..c9de72aee 100644 --- a/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/generated-grpc.apk-conf +++ b/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/generated-grpc.apk-conf @@ -1,24 +1,24 @@ --- name: "6a254687f3229c35dd0189aac7f7fc4b6228e97a" -basePath: "/dineth.grpc.api" +basePath: "/org.apk" version: "v1" type: "GRPC" defaultVersion: false subscriptionValidation: false operations: -- target: "student.StudentService" +- target: "student_service.StudentService" verb: "GetStudent" secured: true scopes: [] -- target: "student.StudentService" +- target: "student_service.StudentService" verb: "GetStudentStream" secured: true scopes: [] -- target: "student.StudentService" +- target: "student_service.StudentService" verb: "SendStudentStream" secured: true scopes: [] -- target: "student.StudentService" +- target: "student_service.StudentService" verb: "SendAndGetStudentStream" secured: true scopes: [] diff --git a/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc.apk-conf b/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc.apk-conf index 93a02570c..e67584573 100644 --- a/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc.apk-conf +++ b/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc.apk-conf @@ -1,6 +1,6 @@ --- -name: "demo-grpc-api" -basePath: "/dineth.grpc.api" +name: "6a254687f3229c35dd0189aac7f7fc4b6228e97a" +basePath: "/org.apk" version: "v1" type: "GRPC" id: "grpc-basic-api" @@ -10,19 +10,19 @@ endpointConfigurations: defaultVersion: false subscriptionValidation: false operations: - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "GetStudent" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "GetStudentStream" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "SendStudentStream" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "SendAndGetStudentStream" secured: true scopes: [] diff --git a/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_scopes.apk-conf b/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_scopes.apk-conf index 0932a60da..4529d9f0d 100644 --- a/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_scopes.apk-conf +++ b/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_scopes.apk-conf @@ -1,6 +1,6 @@ --- -name: "demo-grpc-api" -basePath: "/dineth.grpc.api" +name: "6a254687f3229c35dd0189aac7f7fc4b6228e97a" +basePath: "/org.apk" version: "v1" type: "GRPC" id: "grpc-scopes" @@ -10,19 +10,19 @@ endpointConfigurations: defaultVersion: false subscriptionValidation: false operations: - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "GetStudent" secured: true scopes: ["wso2"] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "GetStudentStream" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "SendStudentStream" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "SendAndGetStudentStream" secured: true scopes: [] diff --git a/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_default_version.apk-conf b/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_default_version.apk-conf index 1c624d2a4..5ce052de1 100644 --- a/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_default_version.apk-conf +++ b/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_default_version.apk-conf @@ -1,6 +1,6 @@ --- -name: "demo-grpc-api" -basePath: "/dineth.grpc.api" +name: "6a254687f3229c35dd0189aac7f7fc4b6228e97a" +basePath: "/org.apk" version: "v1" type: "GRPC" id: "grpc-default-version-api" @@ -10,19 +10,19 @@ endpointConfigurations: defaultVersion: true subscriptionValidation: false operations: - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "GetStudent" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "GetStudentStream" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "SendStudentStream" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "SendAndGetStudentStream" secured: true scopes: [] diff --git a/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_disabled_auth.apk-conf b/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_disabled_auth.apk-conf index 2cbadd921..af89780d7 100644 --- a/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_disabled_auth.apk-conf +++ b/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_disabled_auth.apk-conf @@ -1,6 +1,5 @@ ---- -name: "demo-grpc-api" -basePath: "/dineth.grpc.api" +name: "6a254687f3229c35dd0189aac7f7fc4b6228e97a" +basePath: "/org.apk" version: "v1" type: "GRPC" id: "grpc-auth-disabled-api" @@ -10,19 +9,19 @@ endpointConfigurations: defaultVersion: false subscriptionValidation: false operations: - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "GetStudent" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "GetStudentStream" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "SendStudentStream" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "SendAndGetStudentStream" secured: true scopes: [] diff --git a/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_mtls_mandatory_oauth2_disabled.apk-conf b/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_mtls_mandatory_oauth2_disabled.apk-conf index 16913e85c..77ebe7ae5 100644 --- a/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_mtls_mandatory_oauth2_disabled.apk-conf +++ b/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_mtls_mandatory_oauth2_disabled.apk-conf @@ -1,6 +1,5 @@ ---- -name: "demo-grpc-api" -basePath: "/dineth.grpc.api" +name: "6a254687f3229c35dd0189aac7f7fc4b6228e97a" +basePath: "/org.apk" version: "v1" type: "GRPC" id: "grpc-mtls-mandatory-oauth2-disabled" @@ -10,19 +9,19 @@ endpointConfigurations: defaultVersion: false subscriptionValidation: false operations: - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "GetStudent" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "GetStudentStream" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "SendStudentStream" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "SendAndGetStudentStream" secured: true scopes: [] diff --git a/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_mtls_mandatory_oauth2_mandatory.apk-conf b/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_mtls_mandatory_oauth2_mandatory.apk-conf index 2dca02ea4..9c992da16 100644 --- a/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_mtls_mandatory_oauth2_mandatory.apk-conf +++ b/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_mtls_mandatory_oauth2_mandatory.apk-conf @@ -1,6 +1,5 @@ ---- -name: "demo-grpc-api" -basePath: "/dineth.grpc.api" +name: "6a254687f3229c35dd0189aac7f7fc4b6228e97a" +basePath: "/org.apk" version: "v1" type: "GRPC" id: "grpc-mtls-mandatory-oauth2-mandatory" @@ -10,19 +9,19 @@ endpointConfigurations: defaultVersion: false subscriptionValidation: false operations: - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "GetStudent" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "GetStudentStream" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "SendStudentStream" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "SendAndGetStudentStream" secured: true scopes: [] diff --git a/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_mtls_optional_oauth2_optional.apk-conf b/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_mtls_optional_oauth2_optional.apk-conf index d49048609..9096a33f4 100644 --- a/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_mtls_optional_oauth2_optional.apk-conf +++ b/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/grpc_with_mtls_optional_oauth2_optional.apk-conf @@ -1,6 +1,5 @@ ---- -name: "demo-grpc-api" -basePath: "/dineth.grpc.api" +name: "6a254687f3229c35dd0189aac7f7fc4b6228e97a" +basePath: "/org.apk" version: "v1" type: "GRPC" id: "grpc-mtls-optional-oauth2-optional" @@ -10,19 +9,19 @@ endpointConfigurations: defaultVersion: false subscriptionValidation: false operations: - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "GetStudent" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "GetStudentStream" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "SendStudentStream" secured: true scopes: [] - - target: "student.StudentService" + - target: "student_service.StudentService" verb: "SendAndGetStudentStream" secured: true scopes: [] diff --git a/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/order-with-endpoints.apk-conf b/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/order-with-endpoints.apk-conf new file mode 100644 index 000000000..faab3621f --- /dev/null +++ b/test/cucumber-tests/src/test/resources/artifacts/apk-confs/grpc/order-with-endpoints.apk-conf @@ -0,0 +1,28 @@ +--- +name: "32398767b3b64a7ba1c6aabcd042df4fbd42502a" +id: "grpc-order-api" +basePath: "/grpcapi" +version: "v1" +type: "GRPC" +defaultVersion: false +subscriptionValidation: false +endpointConfigurations: + production: + endpoint: "http://order-backend-service:6566" +operations: + - target: "order.OrderService" + verb: "CreateOrder" + secured: true + scopes: [] + - target: "order.OrderService" + verb: "ServeOrder" + secured: true + scopes: [] + - target: "payment.PaymentService" + verb: "ProcessPayment" + secured: true + scopes: [] + - target: "user.UserService" + verb: "GetUser" + secured: true + scopes: [] diff --git a/test/cucumber-tests/src/test/resources/artifacts/definitions/student.proto b/test/cucumber-tests/src/test/resources/artifacts/definitions/student.proto index 3ca6bbce0..4d2b9cce4 100644 --- a/test/cucumber-tests/src/test/resources/artifacts/definitions/student.proto +++ b/test/cucumber-tests/src/test/resources/artifacts/definitions/student.proto @@ -1,8 +1,9 @@ syntax = "proto3"; +package org.apk.v1.student_service; + option java_multiple_files = true; -option java_package = "org.example"; -package dineth.grpc.api.v1.student; +option java_package = "org.apk.v1.student_service"; service StudentService { rpc GetStudent(StudentRequest) returns (StudentResponse) {}; diff --git a/test/cucumber-tests/src/test/resources/tests/api/GRPC.feature b/test/cucumber-tests/src/test/resources/tests/api/GRPC.feature index e84853b1f..dfbcc8f57 100644 --- a/test/cucumber-tests/src/test/resources/tests/api/GRPC.feature +++ b/test/cucumber-tests/src/test/resources/tests/api/GRPC.feature @@ -24,7 +24,7 @@ Feature: Generating APK conf for gRPC API | Authorization | bearer ${accessToken} | And I make grpc request GetStudent to "default.gw.wso2.com" with port 9095 And the gRPC response status code should be 0 - And the student response body should contain name: "Dineth" age: 10 + And the student response body should contain name: "Student" age: 10 Scenario: Undeploy API Given The system is ready @@ -42,7 +42,7 @@ Feature: Generating APK conf for gRPC API Then I set headers | Authorization | bearer ${accessToken} | | Host | default.gw.wso2.com | - And I send "GET" request to "https://default.gw.wso2.com:9095/dineth.grpc.api.v1/api-definition/" with body "" + And I send "GET" request to "https://default.gw.wso2.com:9095/org.apk.v1/api-definition/" with body "" And I eventually receive 200 response code, not accepting | 429 | | 500 | @@ -64,7 +64,7 @@ Feature: Generating APK conf for gRPC API Then the response status code should be 200 And I make grpc request GetStudent to "default.gw.wso2.com" with port 9095 And the gRPC response status code should be 0 - And the student response body should contain name: "Dineth" age: 10 + And the student response body should contain name: "Student" age: 10 Scenario: Undeploy API Given The system is ready @@ -89,7 +89,7 @@ Feature: Generating APK conf for gRPC API | Authorization | bearer ${accessToken} | And I make grpc request GetStudent to "default.gw.wso2.com" with port 9095 And the gRPC response status code should be 0 - And the student response body should contain name: "Dineth" age: 10 + And the student response body should contain name: "Student" age: 10 Scenario: Undeploy API Given The system is ready @@ -108,13 +108,13 @@ Feature: Generating APK conf for gRPC API | Authorization | bearer ${accessToken} | And I make grpc request GetStudent to "default.gw.wso2.com" with port 9095 And the gRPC response status code should be 0 - And the student response body should contain name: "Dineth" age: 10 + And the student response body should contain name: "Student" age: 10 Given I have a valid subscription Then I set headers | Authorization | bearer ${accessToken} | And I make grpc request GetStudent default version to "default.gw.wso2.com" with port 9095 And the gRPC response status code should be 0 - And the student response body should contain name: "Dineth" age: 10 + And the student response body should contain name: "Student" age: 10 Scenario: Undeploy API Given The system is ready diff --git a/test/cucumber-tests/src/test/resources/tests/api/GRPCMTLS.feature b/test/cucumber-tests/src/test/resources/tests/api/GRPCMTLS.feature index 2856375e7..d1dbee985 100644 --- a/test/cucumber-tests/src/test/resources/tests/api/GRPCMTLS.feature +++ b/test/cucumber-tests/src/test/resources/tests/api/GRPCMTLS.feature @@ -10,7 +10,7 @@ Feature: Test mTLS between client and gateway with client certificate sent in he | X-WSO2-CLIENT-CERTIFICATE | ${clientCertificate} | And I make grpc request GetStudent to "default.gw.wso2.com" with port 9095 And the gRPC response status code should be 0 - And the student response body should contain name: "Dineth" age: 10 + And the student response body should contain name: "Student" age: 10 And I have a valid token with a client certificate "invalid-cert.txt" Then I set headers | X-WSO2-CLIENT-CERTIFICATE | ${clientCertificate} | @@ -65,17 +65,17 @@ Feature: Test mTLS between client and gateway with client certificate sent in he | Authorization | Bearer ${accessToken} | And I make grpc request GetStudent to "default.gw.wso2.com" with port 9095 And the gRPC response status code should be 0 - And the student response body should contain name: "Dineth" age: 10 + And the student response body should contain name: "Student" age: 10 Then I set headers | Authorization | Bearer ${accessToken} | And I make grpc request GetStudent to "default.gw.wso2.com" with port 9095 And the gRPC response status code should be 0 - And the student response body should contain name: "Dineth" age: 10 + And the student response body should contain name: "Student" age: 10 Then I set headers | X-WSO2-CLIENT-CERTIFICATE | ${clientCertificate} | And I make grpc request GetStudent to "default.gw.wso2.com" with port 9095 And the gRPC response status code should be 0 - And the student response body should contain name: "Dineth" age: 10 + And the student response body should contain name: "Student" age: 10 And I have a valid token with a client certificate "invalid-cert.txt" Then I set headers | X-WSO2-CLIENT-CERTIFICATE | ${clientCertificate} |