From 183905ba0b7853b710393b8cd05d92aa69d3501f Mon Sep 17 00:00:00 2001 From: sgayangi Date: Wed, 25 Sep 2024 13:38:28 +0530 Subject: [PATCH 1/3] 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} | From 476532c2c05c7b4ba3089f31e9475c136bd048f2 Mon Sep 17 00:00:00 2001 From: sgayangi Date: Wed, 25 Sep 2024 14:17:51 +0530 Subject: [PATCH 2/3] Update go integration test for gRPC API --- test/integration/go.mod | 30 +-- test/integration/go.sum | 79 ++++--- .../integration/integration/tests/grpc-api.go | 4 +- .../tests/resources/base/manifests.yaml | 20 +- .../tests/resources/tests/grpc-api.yaml | 10 +- .../utils/grpc-code/student/student.go | 8 +- .../utils/grpc-code/student/student.pb.go | 86 +++---- .../grpc-code/student/student_grpc.pb.go | 214 +++++------------ .../student_default_version.pb.go | 144 ++++++------ .../student_default_version_grpc.pb.go | 218 ++++++------------ 10 files changed, 320 insertions(+), 493 deletions(-) diff --git a/test/integration/go.mod b/test/integration/go.mod index abfa51f20..20e4a525f 100644 --- a/test/integration/go.mod +++ b/test/integration/go.mod @@ -5,6 +5,8 @@ go 1.19 require ( github.com/stretchr/testify v1.8.4 github.com/wso2/apk/common-go-libs v0.0.0-20240116050401-5ddd9af96825 + google.golang.org/grpc v1.64.0 + google.golang.org/protobuf v1.33.0 gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.27.2 k8s.io/apimachinery v0.27.2 @@ -16,11 +18,11 @@ require ( github.com/agnivade/levenshtein v1.1.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 // indirect + github.com/cncf/xds/go v0.0.0-20240318125728-8a4994d93e50 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful/v3 v3.9.0 // indirect - github.com/envoyproxy/go-control-plane v0.11.2-0.20230802074621-eea0b3bd0f81 // indirect - github.com/envoyproxy/protoc-gen-validate v1.0.2 // indirect + github.com/envoyproxy/go-control-plane v0.12.0 // indirect + github.com/envoyproxy/protoc-gen-validate v1.0.4 // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-logr/logr v1.2.4 // indirect @@ -29,11 +31,11 @@ require ( github.com/go-openapi/swag v0.22.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -46,7 +48,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.15.1 // indirect - github.com/prometheus/client_model v0.4.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.9.0 // indirect github.com/sirupsen/logrus v1.9.0 // indirect @@ -54,17 +56,15 @@ require ( github.com/vektah/gqlparser v1.3.1 // indirect github.com/wso2/apk/adapter v0.0.0-20231207051518-6dd728943082 // indirect golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect - golang.org/x/net v0.19.0 // indirect - golang.org/x/oauth2 v0.10.0 // indirect - golang.org/x/sys v0.15.0 // indirect - golang.org/x/term v0.15.0 // indirect + golang.org/x/net v0.22.0 // indirect + golang.org/x/oauth2 v0.18.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d // indirect - google.golang.org/grpc v1.58.3 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/test/integration/go.sum b/test/integration/go.sum index 90e27943d..7731e9a33 100644 --- a/test/integration/go.sum +++ b/test/integration/go.sum @@ -14,8 +14,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= -github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20240318125728-8a4994d93e50 h1:DBmgJDC9dTfkVyGgipamEh2BpGYxScCH1TOF1LL1cXc= +github.com/cncf/xds/go v0.0.0-20240318125728-8a4994d93e50/go.mod h1:5e1+Vvlzido69INQaVO6d87Qn543Xr6nooe9Kz7oBFM= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -25,13 +25,12 @@ github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8 github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE= github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.11.2-0.20230802074621-eea0b3bd0f81 h1:dx15VeDt3L5Z0Wx28jXbwgpeTrLsVvqC/wSvNgYPb/k= -github.com/envoyproxy/go-control-plane v0.11.2-0.20230802074621-eea0b3bd0f81/go.mod h1:zV+ml0OfGpQxGvM1qlmhvZzE9ShvBO7CPWzGb3q5cog= +github.com/envoyproxy/go-control-plane v0.12.0 h1:4X+VP1GHd1Mhj6IB5mMeGbLCleqxjletLK6K0rbxyZI= +github.com/envoyproxy/go-control-plane v0.12.0/go.mod h1:ZBTaoJ23lqITozF0M6G4/IragXCQKCnYbmlmtHvwRG0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= -github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= +github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= +github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= @@ -55,7 +54,6 @@ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -65,8 +63,8 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -74,14 +72,15 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -122,8 +121,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/prometheus/client_golang v1.15.1 h1:8tXpTmJbyH5lydzFPoxSIJ0J46jdh3tylbvM1xCv0LI= github.com/prometheus/client_golang v1.15.1/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= @@ -155,6 +154,7 @@ github.com/wso2/apk/common-go-libs v0.0.0-20240116050401-5ddd9af96825 h1:xPADJ/o github.com/wso2/apk/common-go-libs v0.0.0-20240116050401-5ddd9af96825/go.mod h1:OJyTVeVKVX2ZHZPb4ua+Db/Z/4gfocntXMjfNIxX6f8= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= @@ -162,6 +162,7 @@ go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= @@ -170,39 +171,49 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= -golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= +golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= +golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= @@ -216,6 +227,7 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -225,20 +237,19 @@ gomodules.xyz/jsonpatch/v2 v2.3.0 h1:8NFhfS6gzxNqjLIYnZxg319wZ5Qjnx4m/CcX+Klzazc gomodules.xyz/jsonpatch/v2 v2.3.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d h1:pgIUhmqwKOUlnKna4r6amKdUngdL8DrkpFeV8+VBElY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= -google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -249,8 +260,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/test/integration/integration/tests/grpc-api.go b/test/integration/integration/tests/grpc-api.go index a5b46aac0..2ddf270d7 100644 --- a/test/integration/integration/tests/grpc-api.go +++ b/test/integration/integration/tests/grpc-api.go @@ -42,7 +42,7 @@ var GRPCAPI = suite.IntegrationTest{ { ExpectedResponse: grpcutils.ExpectedResponse{ Out: &student.StudentResponse{ - Name: "Dineth", + Name: "Student", Age: 10, }, Err: nil, @@ -55,7 +55,7 @@ var GRPCAPI = suite.IntegrationTest{ { ExpectedResponse: grpcutils.ExpectedResponse{ Out: &student_default_version.StudentResponse{ - Name: "Dineth", + Name: "Student", Age: 10, }, Err: nil, diff --git a/test/integration/integration/tests/resources/base/manifests.yaml b/test/integration/integration/tests/resources/base/manifests.yaml index 81592bc23..6c675d5d0 100644 --- a/test/integration/integration/tests/resources/base/manifests.yaml +++ b/test/integration/integration/tests/resources/base/manifests.yaml @@ -122,7 +122,7 @@ spec: ports: - protocol: TCP port: 6565 - targetPort: 6565 + targetPort: 9090 --- apiVersion: apps/v1 kind: Deployment @@ -142,21 +142,11 @@ spec: app: grpc-backend-v1 spec: containers: - - name: grpc-backend-v1 - image: ddh13/dineth-grpc-demo-server:1.0.0 + - name: grpc-backend + 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: v1 kind: Service diff --git a/test/integration/integration/tests/resources/tests/grpc-api.yaml b/test/integration/integration/tests/resources/tests/grpc-api.yaml index 885c44eab..64f59df6e 100644 --- a/test/integration/integration/tests/resources/tests/grpc-api.yaml +++ b/test/integration/integration/tests/resources/tests/grpc-api.yaml @@ -23,7 +23,7 @@ spec: apiName: GRPC API apiType: GRPC apiVersion: v1 - basePath: /dineth.grpc.api.v1 + basePath: /org.apk.v1 isDefaultVersion: true production: - routeRefs: @@ -47,7 +47,7 @@ spec: rules: - matches: - method: - service: student.StudentService + service: student_service.StudentService method: GetStudent backendRefs: - name: grpc-backend-v1 @@ -55,7 +55,7 @@ spec: port: 6565 - matches: - method: - service: student.StudentService + service: student_service.StudentService method: SendStudentStream backendRefs: - name: grpc-backend-v1 @@ -63,7 +63,7 @@ spec: port: 6565 - matches: - method: - service: student.StudentService + service: student_service.StudentService method: GetStudentStream backendRefs: - name: grpc-backend-v1 @@ -71,7 +71,7 @@ spec: port: 6565 - matches: - method: - service: student.StudentService + service: student_service.StudentService method: SendAndGetStudentStream backendRefs: - name: grpc-backend-v1 diff --git a/test/integration/integration/utils/grpc-code/student/student.go b/test/integration/integration/utils/grpc-code/student/student.go index be01a82f5..c2392e7d8 100644 --- a/test/integration/integration/utils/grpc-code/student/student.go +++ b/test/integration/integration/utils/grpc-code/student/student.go @@ -13,16 +13,16 @@ type StudentResponseSatisfier struct{} // IsSatisfactory checks if the given response is satisfactory based on the expected response. func (srs StudentResponseSatisfier) IsSatisfactory(response any, expectedResponse grpcutils.ExpectedResponse) bool { - // Type assert the response to *student.StudentResponse + // Type assert the response to *student_service.StudentResponse resp, respOk := response.(*StudentResponse) if !respOk { - log.Println("Failed to assert response as *student.StudentResponse") + log.Println("Failed to assert response as *student_service.StudentResponse") return false } - // Type assert the expected output to *student.StudentResponse + // Type assert the expected output to *student_service.StudentResponse expectedResp, expOk := expectedResponse.Out.(*StudentResponse) if !expOk { - log.Println("Failed to assert expectedResponse.Out as *student.StudentResponse") + log.Println("Failed to assert expectedResponse.Out as *student_service.StudentResponse") return false } diff --git a/test/integration/integration/utils/grpc-code/student/student.pb.go b/test/integration/integration/utils/grpc-code/student/student.pb.go index 2a1e74b08..0727ef1c4 100644 --- a/test/integration/integration/utils/grpc-code/student/student.pb.go +++ b/test/integration/integration/utils/grpc-code/student/student.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.33.0 -// protoc v3.12.4 +// protoc-gen-go v1.34.2 +// protoc v5.28.0 // source: student.proto package student @@ -126,8 +126,8 @@ var File_student_proto protoreflect.FileDescriptor var file_student_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x1a, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x22, 0x20, 0x0a, 0x0e, 0x53, + 0x1a, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, + 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x0a, 0x0e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x37, 0x0a, 0x0f, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, @@ -135,38 +135,38 @@ var file_student_proto_rawDesc = []byte{ 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x67, 0x65, 0x32, 0xd6, 0x03, 0x0a, 0x0e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x67, 0x0a, 0x0a, 0x47, 0x65, 0x74, - 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, - 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, + 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, + 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x76, 0x31, + 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6f, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x2a, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, - 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x2a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, + 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x76, 0x31, 0x2e, + 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x70, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x75, 0x64, 0x65, - 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x2a, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, - 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, - 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, - 0x74, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x2a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, + 0x70, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x76, + 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x12, 0x78, 0x0a, 0x17, 0x53, 0x65, 0x6e, 0x64, 0x41, 0x6e, 0x64, 0x47, 0x65, 0x74, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x12, 0x2a, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, - 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x64, - 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, + 0x12, 0x2a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, + 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, + 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6f, + 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, + 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, - 0x30, 0x5a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, - 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x73, 0x2f, 0x73, 0x63, 0x68, 0x6f, 0x6f, 0x6c, 0x2f, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, - 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x28, 0x0a, 0x1a, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, + 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x01, 0x5a, + 0x08, 0x2f, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -182,19 +182,19 @@ func file_student_proto_rawDescGZIP() []byte { } var file_student_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_student_proto_goTypes = []interface{}{ - (*StudentRequest)(nil), // 0: dineth.grpc.api.v1.student.StudentRequest - (*StudentResponse)(nil), // 1: dineth.grpc.api.v1.student.StudentResponse +var file_student_proto_goTypes = []any{ + (*StudentRequest)(nil), // 0: org.apk.v1.student_service.StudentRequest + (*StudentResponse)(nil), // 1: org.apk.v1.student_service.StudentResponse } var file_student_proto_depIdxs = []int32{ - 0, // 0: dineth.grpc.api.v1.student.StudentService.GetStudent:input_type -> dineth.grpc.api.v1.student.StudentRequest - 0, // 1: dineth.grpc.api.v1.student.StudentService.GetStudentStream:input_type -> dineth.grpc.api.v1.student.StudentRequest - 0, // 2: dineth.grpc.api.v1.student.StudentService.SendStudentStream:input_type -> dineth.grpc.api.v1.student.StudentRequest - 0, // 3: dineth.grpc.api.v1.student.StudentService.SendAndGetStudentStream:input_type -> dineth.grpc.api.v1.student.StudentRequest - 1, // 4: dineth.grpc.api.v1.student.StudentService.GetStudent:output_type -> dineth.grpc.api.v1.student.StudentResponse - 1, // 5: dineth.grpc.api.v1.student.StudentService.GetStudentStream:output_type -> dineth.grpc.api.v1.student.StudentResponse - 1, // 6: dineth.grpc.api.v1.student.StudentService.SendStudentStream:output_type -> dineth.grpc.api.v1.student.StudentResponse - 1, // 7: dineth.grpc.api.v1.student.StudentService.SendAndGetStudentStream:output_type -> dineth.grpc.api.v1.student.StudentResponse + 0, // 0: org.apk.v1.student_service.StudentService.GetStudent:input_type -> org.apk.v1.student_service.StudentRequest + 0, // 1: org.apk.v1.student_service.StudentService.GetStudentStream:input_type -> org.apk.v1.student_service.StudentRequest + 0, // 2: org.apk.v1.student_service.StudentService.SendStudentStream:input_type -> org.apk.v1.student_service.StudentRequest + 0, // 3: org.apk.v1.student_service.StudentService.SendAndGetStudentStream:input_type -> org.apk.v1.student_service.StudentRequest + 1, // 4: org.apk.v1.student_service.StudentService.GetStudent:output_type -> org.apk.v1.student_service.StudentResponse + 1, // 5: org.apk.v1.student_service.StudentService.GetStudentStream:output_type -> org.apk.v1.student_service.StudentResponse + 1, // 6: org.apk.v1.student_service.StudentService.SendStudentStream:output_type -> org.apk.v1.student_service.StudentResponse + 1, // 7: org.apk.v1.student_service.StudentService.SendAndGetStudentStream:output_type -> org.apk.v1.student_service.StudentResponse 4, // [4:8] is the sub-list for method output_type 0, // [0:4] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -208,7 +208,7 @@ func file_student_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_student_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_student_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*StudentRequest); i { case 0: return &v.state @@ -220,7 +220,7 @@ func file_student_proto_init() { return nil } } - file_student_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_student_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*StudentResponse); i { case 0: return &v.state @@ -251,4 +251,4 @@ func file_student_proto_init() { file_student_proto_rawDesc = nil file_student_proto_goTypes = nil file_student_proto_depIdxs = nil -} \ No newline at end of file +} diff --git a/test/integration/integration/utils/grpc-code/student/student_grpc.pb.go b/test/integration/integration/utils/grpc-code/student/student_grpc.pb.go index 52cad0142..a646d457c 100644 --- a/test/integration/integration/utils/grpc-code/student/student_grpc.pb.go +++ b/test/integration/integration/utils/grpc-code/student/student_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.12.4 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.28.0 // source: student.proto package student @@ -15,14 +15,14 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( - StudentService_GetStudent_FullMethodName = "/dineth.grpc.api.v1.student.StudentService/GetStudent" - StudentService_GetStudentStream_FullMethodName = "/dineth.grpc.api.v1.student.StudentService/GetStudentStream" - StudentService_SendStudentStream_FullMethodName = "/dineth.grpc.api.v1.student.StudentService/SendStudentStream" - StudentService_SendAndGetStudentStream_FullMethodName = "/dineth.grpc.api.v1.student.StudentService/SendAndGetStudentStream" + StudentService_GetStudent_FullMethodName = "/org.apk.v1.student_service.StudentService/GetStudent" + StudentService_GetStudentStream_FullMethodName = "/org.apk.v1.student_service.StudentService/GetStudentStream" + StudentService_SendStudentStream_FullMethodName = "/org.apk.v1.student_service.StudentService/SendStudentStream" + StudentService_SendAndGetStudentStream_FullMethodName = "/org.apk.v1.student_service.StudentService/SendAndGetStudentStream" ) // StudentServiceClient is the client API for StudentService service. @@ -30,9 +30,9 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type StudentServiceClient interface { GetStudent(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (*StudentResponse, error) - GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (StudentService_GetStudentStreamClient, error) - SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (StudentService_SendStudentStreamClient, error) - SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (StudentService_SendAndGetStudentStreamClient, error) + GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StudentResponse], error) + SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[StudentRequest, StudentResponse], error) + SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StudentRequest, StudentResponse], error) } type studentServiceClient struct { @@ -44,20 +44,22 @@ func NewStudentServiceClient(cc grpc.ClientConnInterface) StudentServiceClient { } func (c *studentServiceClient) GetStudent(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (*StudentResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(StudentResponse) - err := c.cc.Invoke(ctx, StudentService_GetStudent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, StudentService_GetStudent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *studentServiceClient) GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (StudentService_GetStudentStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[0], StudentService_GetStudentStream_FullMethodName, opts...) +func (c *studentServiceClient) GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StudentResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[0], StudentService_GetStudentStream_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &studentServiceGetStudentStreamClient{stream} + x := &grpc.GenericClientStream[StudentRequest, StudentResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -67,116 +69,67 @@ func (c *studentServiceClient) GetStudentStream(ctx context.Context, in *Student return x, nil } -type StudentService_GetStudentStreamClient interface { - Recv() (*StudentResponse, error) - grpc.ClientStream -} - -type studentServiceGetStudentStreamClient struct { - grpc.ClientStream -} - -func (x *studentServiceGetStudentStreamClient) Recv() (*StudentResponse, error) { - m := new(StudentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_GetStudentStreamClient = grpc.ServerStreamingClient[StudentResponse] -func (c *studentServiceClient) SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (StudentService_SendStudentStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[1], StudentService_SendStudentStream_FullMethodName, opts...) +func (c *studentServiceClient) SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[StudentRequest, StudentResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[1], StudentService_SendStudentStream_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &studentServiceSendStudentStreamClient{stream} + x := &grpc.GenericClientStream[StudentRequest, StudentResponse]{ClientStream: stream} return x, nil } -type StudentService_SendStudentStreamClient interface { - Send(*StudentRequest) error - CloseAndRecv() (*StudentResponse, error) - grpc.ClientStream -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_SendStudentStreamClient = grpc.ClientStreamingClient[StudentRequest, StudentResponse] -type studentServiceSendStudentStreamClient struct { - grpc.ClientStream -} - -func (x *studentServiceSendStudentStreamClient) Send(m *StudentRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *studentServiceSendStudentStreamClient) CloseAndRecv() (*StudentResponse, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(StudentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *studentServiceClient) SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (StudentService_SendAndGetStudentStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[2], StudentService_SendAndGetStudentStream_FullMethodName, opts...) +func (c *studentServiceClient) SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StudentRequest, StudentResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[2], StudentService_SendAndGetStudentStream_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &studentServiceSendAndGetStudentStreamClient{stream} + x := &grpc.GenericClientStream[StudentRequest, StudentResponse]{ClientStream: stream} return x, nil } -type StudentService_SendAndGetStudentStreamClient interface { - Send(*StudentRequest) error - Recv() (*StudentResponse, error) - grpc.ClientStream -} - -type studentServiceSendAndGetStudentStreamClient struct { - grpc.ClientStream -} - -func (x *studentServiceSendAndGetStudentStreamClient) Send(m *StudentRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *studentServiceSendAndGetStudentStreamClient) Recv() (*StudentResponse, error) { - m := new(StudentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_SendAndGetStudentStreamClient = grpc.BidiStreamingClient[StudentRequest, StudentResponse] // StudentServiceServer is the server API for StudentService service. // All implementations must embed UnimplementedStudentServiceServer -// for forward compatibility +// for forward compatibility. type StudentServiceServer interface { GetStudent(context.Context, *StudentRequest) (*StudentResponse, error) - GetStudentStream(*StudentRequest, StudentService_GetStudentStreamServer) error - SendStudentStream(StudentService_SendStudentStreamServer) error - SendAndGetStudentStream(StudentService_SendAndGetStudentStreamServer) error + GetStudentStream(*StudentRequest, grpc.ServerStreamingServer[StudentResponse]) error + SendStudentStream(grpc.ClientStreamingServer[StudentRequest, StudentResponse]) error + SendAndGetStudentStream(grpc.BidiStreamingServer[StudentRequest, StudentResponse]) error mustEmbedUnimplementedStudentServiceServer() } -// UnimplementedStudentServiceServer must be embedded to have forward compatible implementations. -type UnimplementedStudentServiceServer struct { -} +// UnimplementedStudentServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedStudentServiceServer struct{} func (UnimplementedStudentServiceServer) GetStudent(context.Context, *StudentRequest) (*StudentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetStudent not implemented") } -func (UnimplementedStudentServiceServer) GetStudentStream(*StudentRequest, StudentService_GetStudentStreamServer) error { +func (UnimplementedStudentServiceServer) GetStudentStream(*StudentRequest, grpc.ServerStreamingServer[StudentResponse]) error { return status.Errorf(codes.Unimplemented, "method GetStudentStream not implemented") } -func (UnimplementedStudentServiceServer) SendStudentStream(StudentService_SendStudentStreamServer) error { +func (UnimplementedStudentServiceServer) SendStudentStream(grpc.ClientStreamingServer[StudentRequest, StudentResponse]) error { return status.Errorf(codes.Unimplemented, "method SendStudentStream not implemented") } -func (UnimplementedStudentServiceServer) SendAndGetStudentStream(StudentService_SendAndGetStudentStreamServer) error { +func (UnimplementedStudentServiceServer) SendAndGetStudentStream(grpc.BidiStreamingServer[StudentRequest, StudentResponse]) error { return status.Errorf(codes.Unimplemented, "method SendAndGetStudentStream not implemented") } func (UnimplementedStudentServiceServer) mustEmbedUnimplementedStudentServiceServer() {} +func (UnimplementedStudentServiceServer) testEmbeddedByValue() {} // UnsafeStudentServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to StudentServiceServer will @@ -186,6 +139,13 @@ type UnsafeStudentServiceServer interface { } func RegisterStudentServiceServer(s grpc.ServiceRegistrar, srv StudentServiceServer) { + // If the following call pancis, it indicates UnimplementedStudentServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&StudentService_ServiceDesc, srv) } @@ -212,79 +172,31 @@ func _StudentService_GetStudentStream_Handler(srv interface{}, stream grpc.Serve if err := stream.RecvMsg(m); err != nil { return err } - return srv.(StudentServiceServer).GetStudentStream(m, &studentServiceGetStudentStreamServer{stream}) -} - -type StudentService_GetStudentStreamServer interface { - Send(*StudentResponse) error - grpc.ServerStream + return srv.(StudentServiceServer).GetStudentStream(m, &grpc.GenericServerStream[StudentRequest, StudentResponse]{ServerStream: stream}) } -type studentServiceGetStudentStreamServer struct { - grpc.ServerStream -} - -func (x *studentServiceGetStudentStreamServer) Send(m *StudentResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_GetStudentStreamServer = grpc.ServerStreamingServer[StudentResponse] func _StudentService_SendStudentStream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(StudentServiceServer).SendStudentStream(&studentServiceSendStudentStreamServer{stream}) + return srv.(StudentServiceServer).SendStudentStream(&grpc.GenericServerStream[StudentRequest, StudentResponse]{ServerStream: stream}) } -type StudentService_SendStudentStreamServer interface { - SendAndClose(*StudentResponse) error - Recv() (*StudentRequest, error) - grpc.ServerStream -} - -type studentServiceSendStudentStreamServer struct { - grpc.ServerStream -} - -func (x *studentServiceSendStudentStreamServer) SendAndClose(m *StudentResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *studentServiceSendStudentStreamServer) Recv() (*StudentRequest, error) { - m := new(StudentRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_SendStudentStreamServer = grpc.ClientStreamingServer[StudentRequest, StudentResponse] func _StudentService_SendAndGetStudentStream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(StudentServiceServer).SendAndGetStudentStream(&studentServiceSendAndGetStudentStreamServer{stream}) -} - -type StudentService_SendAndGetStudentStreamServer interface { - Send(*StudentResponse) error - Recv() (*StudentRequest, error) - grpc.ServerStream -} - -type studentServiceSendAndGetStudentStreamServer struct { - grpc.ServerStream + return srv.(StudentServiceServer).SendAndGetStudentStream(&grpc.GenericServerStream[StudentRequest, StudentResponse]{ServerStream: stream}) } -func (x *studentServiceSendAndGetStudentStreamServer) Send(m *StudentResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *studentServiceSendAndGetStudentStreamServer) Recv() (*StudentRequest, error) { - m := new(StudentRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_SendAndGetStudentStreamServer = grpc.BidiStreamingServer[StudentRequest, StudentResponse] // StudentService_ServiceDesc is the grpc.ServiceDesc for StudentService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var StudentService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "dineth.grpc.api.v1.student.StudentService", + ServiceName: "org.apk.v1.student_service.StudentService", HandlerType: (*StudentServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -311,4 +223,4 @@ var StudentService_ServiceDesc = grpc.ServiceDesc{ }, }, Metadata: "student.proto", -} \ No newline at end of file +} diff --git a/test/integration/integration/utils/grpc-code/student_default_version/student_default_version.pb.go b/test/integration/integration/utils/grpc-code/student_default_version/student_default_version.pb.go index 3437a246f..7871032d8 100644 --- a/test/integration/integration/utils/grpc-code/student_default_version/student_default_version.pb.go +++ b/test/integration/integration/utils/grpc-code/student_default_version/student_default_version.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.33.0 -// protoc v3.12.4 -// source: student_default_version.proto +// protoc-gen-go v1.34.2 +// protoc v5.28.0 +// source: student.proto package student_default_version @@ -31,7 +31,7 @@ type StudentRequest struct { func (x *StudentRequest) Reset() { *x = StudentRequest{} if protoimpl.UnsafeEnabled { - mi := &file_student_default_version_proto_msgTypes[0] + mi := &file_student_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -44,7 +44,7 @@ func (x *StudentRequest) String() string { func (*StudentRequest) ProtoMessage() {} func (x *StudentRequest) ProtoReflect() protoreflect.Message { - mi := &file_student_default_version_proto_msgTypes[0] + mi := &file_student_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -57,7 +57,7 @@ func (x *StudentRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StudentRequest.ProtoReflect.Descriptor instead. func (*StudentRequest) Descriptor() ([]byte, []int) { - return file_student_default_version_proto_rawDescGZIP(), []int{0} + return file_student_proto_rawDescGZIP(), []int{0} } func (x *StudentRequest) GetId() int32 { @@ -79,7 +79,7 @@ type StudentResponse struct { func (x *StudentResponse) Reset() { *x = StudentResponse{} if protoimpl.UnsafeEnabled { - mi := &file_student_default_version_proto_msgTypes[1] + mi := &file_student_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -92,7 +92,7 @@ func (x *StudentResponse) String() string { func (*StudentResponse) ProtoMessage() {} func (x *StudentResponse) ProtoReflect() protoreflect.Message { - mi := &file_student_default_version_proto_msgTypes[1] + mi := &file_student_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -105,7 +105,7 @@ func (x *StudentResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StudentResponse.ProtoReflect.Descriptor instead. func (*StudentResponse) Descriptor() ([]byte, []int) { - return file_student_default_version_proto_rawDescGZIP(), []int{1} + return file_student_proto_rawDescGZIP(), []int{1} } func (x *StudentResponse) GetName() string { @@ -122,13 +122,12 @@ func (x *StudentResponse) GetAge() int32 { return 0 } -var File_student_default_version_proto protoreflect.FileDescriptor +var File_student_proto protoreflect.FileDescriptor -var file_student_default_version_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x17, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x22, 0x20, 0x0a, 0x0e, 0x53, 0x74, 0x75, 0x64, +var file_student_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x17, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, + 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x0a, 0x0e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x37, 0x0a, 0x0f, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, @@ -136,62 +135,65 @@ var file_student_default_version_proto_rawDesc = []byte{ 0x65, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x67, 0x65, 0x32, 0xbe, 0x03, 0x0a, 0x0e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x61, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x74, 0x75, - 0x64, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, + 0x64, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, + 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, - 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, + 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x69, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x27, 0x2e, - 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, + 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, + 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x6a, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x75, 0x64, - 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x27, 0x2e, 0x64, 0x69, 0x6e, 0x65, - 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x74, 0x75, 0x64, - 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x75, + 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x27, 0x2e, 0x6f, 0x72, 0x67, 0x2e, + 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, + 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x12, 0x72, 0x0a, 0x17, 0x53, 0x65, 0x6e, 0x64, 0x41, 0x6e, 0x64, 0x47, 0x65, 0x74, 0x53, 0x74, - 0x75, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x27, 0x2e, 0x64, 0x69, - 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x74, - 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x64, 0x69, 0x6e, 0x65, 0x74, 0x68, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, + 0x75, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x27, 0x2e, 0x6f, 0x72, + 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, + 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x28, 0x01, 0x30, 0x01, 0x42, 0x0f, 0x0a, 0x0b, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x50, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x28, 0x01, 0x30, 0x01, 0x42, 0x38, 0x0a, 0x1a, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, + 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x50, 0x01, 0x5a, 0x18, 0x2f, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_student_default_version_proto_rawDescOnce sync.Once - file_student_default_version_proto_rawDescData = file_student_default_version_proto_rawDesc + file_student_proto_rawDescOnce sync.Once + file_student_proto_rawDescData = file_student_proto_rawDesc ) -func file_student_default_version_proto_rawDescGZIP() []byte { - file_student_default_version_proto_rawDescOnce.Do(func() { - file_student_default_version_proto_rawDescData = protoimpl.X.CompressGZIP(file_student_default_version_proto_rawDescData) +func file_student_proto_rawDescGZIP() []byte { + file_student_proto_rawDescOnce.Do(func() { + file_student_proto_rawDescData = protoimpl.X.CompressGZIP(file_student_proto_rawDescData) }) - return file_student_default_version_proto_rawDescData -} - -var file_student_default_version_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_student_default_version_proto_goTypes = []interface{}{ - (*StudentRequest)(nil), // 0: dineth.grpc.api.student.StudentRequest - (*StudentResponse)(nil), // 1: dineth.grpc.api.student.StudentResponse -} -var file_student_default_version_proto_depIdxs = []int32{ - 0, // 0: dineth.grpc.api.student.StudentService.GetStudent:input_type -> dineth.grpc.api.student.StudentRequest - 0, // 1: dineth.grpc.api.student.StudentService.GetStudentStream:input_type -> dineth.grpc.api.student.StudentRequest - 0, // 2: dineth.grpc.api.student.StudentService.SendStudentStream:input_type -> dineth.grpc.api.student.StudentRequest - 0, // 3: dineth.grpc.api.student.StudentService.SendAndGetStudentStream:input_type -> dineth.grpc.api.student.StudentRequest - 1, // 4: dineth.grpc.api.student.StudentService.GetStudent:output_type -> dineth.grpc.api.student.StudentResponse - 1, // 5: dineth.grpc.api.student.StudentService.GetStudentStream:output_type -> dineth.grpc.api.student.StudentResponse - 1, // 6: dineth.grpc.api.student.StudentService.SendStudentStream:output_type -> dineth.grpc.api.student.StudentResponse - 1, // 7: dineth.grpc.api.student.StudentService.SendAndGetStudentStream:output_type -> dineth.grpc.api.student.StudentResponse + return file_student_proto_rawDescData +} + +var file_student_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_student_proto_goTypes = []any{ + (*StudentRequest)(nil), // 0: org.apk.student_service.StudentRequest + (*StudentResponse)(nil), // 1: org.apk.student_service.StudentResponse +} +var file_student_proto_depIdxs = []int32{ + 0, // 0: org.apk.student_service.StudentService.GetStudent:input_type -> org.apk.student_service.StudentRequest + 0, // 1: org.apk.student_service.StudentService.GetStudentStream:input_type -> org.apk.student_service.StudentRequest + 0, // 2: org.apk.student_service.StudentService.SendStudentStream:input_type -> org.apk.student_service.StudentRequest + 0, // 3: org.apk.student_service.StudentService.SendAndGetStudentStream:input_type -> org.apk.student_service.StudentRequest + 1, // 4: org.apk.student_service.StudentService.GetStudent:output_type -> org.apk.student_service.StudentResponse + 1, // 5: org.apk.student_service.StudentService.GetStudentStream:output_type -> org.apk.student_service.StudentResponse + 1, // 6: org.apk.student_service.StudentService.SendStudentStream:output_type -> org.apk.student_service.StudentResponse + 1, // 7: org.apk.student_service.StudentService.SendAndGetStudentStream:output_type -> org.apk.student_service.StudentResponse 4, // [4:8] is the sub-list for method output_type 0, // [0:4] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -199,13 +201,13 @@ var file_student_default_version_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_student_default_version_proto_init() } -func file_student_default_version_proto_init() { - if File_student_default_version_proto != nil { +func init() { file_student_proto_init() } +func file_student_proto_init() { + if File_student_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_student_default_version_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_student_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*StudentRequest); i { case 0: return &v.state @@ -217,7 +219,7 @@ func file_student_default_version_proto_init() { return nil } } - file_student_default_version_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_student_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*StudentResponse); i { case 0: return &v.state @@ -234,18 +236,18 @@ func file_student_default_version_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_student_default_version_proto_rawDesc, + RawDescriptor: file_student_proto_rawDesc, NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_student_default_version_proto_goTypes, - DependencyIndexes: file_student_default_version_proto_depIdxs, - MessageInfos: file_student_default_version_proto_msgTypes, + GoTypes: file_student_proto_goTypes, + DependencyIndexes: file_student_proto_depIdxs, + MessageInfos: file_student_proto_msgTypes, }.Build() - File_student_default_version_proto = out.File - file_student_default_version_proto_rawDesc = nil - file_student_default_version_proto_goTypes = nil - file_student_default_version_proto_depIdxs = nil -} \ No newline at end of file + File_student_proto = out.File + file_student_proto_rawDesc = nil + file_student_proto_goTypes = nil + file_student_proto_depIdxs = nil +} diff --git a/test/integration/integration/utils/grpc-code/student_default_version/student_default_version_grpc.pb.go b/test/integration/integration/utils/grpc-code/student_default_version/student_default_version_grpc.pb.go index c2ca3f998..6bf5503af 100644 --- a/test/integration/integration/utils/grpc-code/student_default_version/student_default_version_grpc.pb.go +++ b/test/integration/integration/utils/grpc-code/student_default_version/student_default_version_grpc.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.12.4 -// source: student_default_version.proto +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.28.0 +// source: student.proto package student_default_version @@ -15,14 +15,14 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( - StudentService_GetStudent_FullMethodName = "/dineth.grpc.api.student.StudentService/GetStudent" - StudentService_GetStudentStream_FullMethodName = "/dineth.grpc.api.student.StudentService/GetStudentStream" - StudentService_SendStudentStream_FullMethodName = "/dineth.grpc.api.student.StudentService/SendStudentStream" - StudentService_SendAndGetStudentStream_FullMethodName = "/dineth.grpc.api.student.StudentService/SendAndGetStudentStream" + StudentService_GetStudent_FullMethodName = "/org.apk.student_service.StudentService/GetStudent" + StudentService_GetStudentStream_FullMethodName = "/org.apk.student_service.StudentService/GetStudentStream" + StudentService_SendStudentStream_FullMethodName = "/org.apk.student_service.StudentService/SendStudentStream" + StudentService_SendAndGetStudentStream_FullMethodName = "/org.apk.student_service.StudentService/SendAndGetStudentStream" ) // StudentServiceClient is the client API for StudentService service. @@ -30,9 +30,9 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type StudentServiceClient interface { GetStudent(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (*StudentResponse, error) - GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (StudentService_GetStudentStreamClient, error) - SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (StudentService_SendStudentStreamClient, error) - SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (StudentService_SendAndGetStudentStreamClient, error) + GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StudentResponse], error) + SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[StudentRequest, StudentResponse], error) + SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StudentRequest, StudentResponse], error) } type studentServiceClient struct { @@ -44,20 +44,22 @@ func NewStudentServiceClient(cc grpc.ClientConnInterface) StudentServiceClient { } func (c *studentServiceClient) GetStudent(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (*StudentResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(StudentResponse) - err := c.cc.Invoke(ctx, StudentService_GetStudent_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, StudentService_GetStudent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *studentServiceClient) GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (StudentService_GetStudentStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[0], StudentService_GetStudentStream_FullMethodName, opts...) +func (c *studentServiceClient) GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StudentResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[0], StudentService_GetStudentStream_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &studentServiceGetStudentStreamClient{stream} + x := &grpc.GenericClientStream[StudentRequest, StudentResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -67,116 +69,67 @@ func (c *studentServiceClient) GetStudentStream(ctx context.Context, in *Student return x, nil } -type StudentService_GetStudentStreamClient interface { - Recv() (*StudentResponse, error) - grpc.ClientStream -} - -type studentServiceGetStudentStreamClient struct { - grpc.ClientStream -} - -func (x *studentServiceGetStudentStreamClient) Recv() (*StudentResponse, error) { - m := new(StudentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_GetStudentStreamClient = grpc.ServerStreamingClient[StudentResponse] -func (c *studentServiceClient) SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (StudentService_SendStudentStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[1], StudentService_SendStudentStream_FullMethodName, opts...) +func (c *studentServiceClient) SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[StudentRequest, StudentResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[1], StudentService_SendStudentStream_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &studentServiceSendStudentStreamClient{stream} + x := &grpc.GenericClientStream[StudentRequest, StudentResponse]{ClientStream: stream} return x, nil } -type StudentService_SendStudentStreamClient interface { - Send(*StudentRequest) error - CloseAndRecv() (*StudentResponse, error) - grpc.ClientStream -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_SendStudentStreamClient = grpc.ClientStreamingClient[StudentRequest, StudentResponse] -type studentServiceSendStudentStreamClient struct { - grpc.ClientStream -} - -func (x *studentServiceSendStudentStreamClient) Send(m *StudentRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *studentServiceSendStudentStreamClient) CloseAndRecv() (*StudentResponse, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(StudentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *studentServiceClient) SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (StudentService_SendAndGetStudentStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[2], StudentService_SendAndGetStudentStream_FullMethodName, opts...) +func (c *studentServiceClient) SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StudentRequest, StudentResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[2], StudentService_SendAndGetStudentStream_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &studentServiceSendAndGetStudentStreamClient{stream} + x := &grpc.GenericClientStream[StudentRequest, StudentResponse]{ClientStream: stream} return x, nil } -type StudentService_SendAndGetStudentStreamClient interface { - Send(*StudentRequest) error - Recv() (*StudentResponse, error) - grpc.ClientStream -} - -type studentServiceSendAndGetStudentStreamClient struct { - grpc.ClientStream -} - -func (x *studentServiceSendAndGetStudentStreamClient) Send(m *StudentRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *studentServiceSendAndGetStudentStreamClient) Recv() (*StudentResponse, error) { - m := new(StudentResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_SendAndGetStudentStreamClient = grpc.BidiStreamingClient[StudentRequest, StudentResponse] // StudentServiceServer is the server API for StudentService service. // All implementations must embed UnimplementedStudentServiceServer -// for forward compatibility +// for forward compatibility. type StudentServiceServer interface { GetStudent(context.Context, *StudentRequest) (*StudentResponse, error) - GetStudentStream(*StudentRequest, StudentService_GetStudentStreamServer) error - SendStudentStream(StudentService_SendStudentStreamServer) error - SendAndGetStudentStream(StudentService_SendAndGetStudentStreamServer) error + GetStudentStream(*StudentRequest, grpc.ServerStreamingServer[StudentResponse]) error + SendStudentStream(grpc.ClientStreamingServer[StudentRequest, StudentResponse]) error + SendAndGetStudentStream(grpc.BidiStreamingServer[StudentRequest, StudentResponse]) error mustEmbedUnimplementedStudentServiceServer() } -// UnimplementedStudentServiceServer must be embedded to have forward compatible implementations. -type UnimplementedStudentServiceServer struct { -} +// UnimplementedStudentServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedStudentServiceServer struct{} func (UnimplementedStudentServiceServer) GetStudent(context.Context, *StudentRequest) (*StudentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetStudent not implemented") } -func (UnimplementedStudentServiceServer) GetStudentStream(*StudentRequest, StudentService_GetStudentStreamServer) error { +func (UnimplementedStudentServiceServer) GetStudentStream(*StudentRequest, grpc.ServerStreamingServer[StudentResponse]) error { return status.Errorf(codes.Unimplemented, "method GetStudentStream not implemented") } -func (UnimplementedStudentServiceServer) SendStudentStream(StudentService_SendStudentStreamServer) error { +func (UnimplementedStudentServiceServer) SendStudentStream(grpc.ClientStreamingServer[StudentRequest, StudentResponse]) error { return status.Errorf(codes.Unimplemented, "method SendStudentStream not implemented") } -func (UnimplementedStudentServiceServer) SendAndGetStudentStream(StudentService_SendAndGetStudentStreamServer) error { +func (UnimplementedStudentServiceServer) SendAndGetStudentStream(grpc.BidiStreamingServer[StudentRequest, StudentResponse]) error { return status.Errorf(codes.Unimplemented, "method SendAndGetStudentStream not implemented") } func (UnimplementedStudentServiceServer) mustEmbedUnimplementedStudentServiceServer() {} +func (UnimplementedStudentServiceServer) testEmbeddedByValue() {} // UnsafeStudentServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to StudentServiceServer will @@ -186,6 +139,13 @@ type UnsafeStudentServiceServer interface { } func RegisterStudentServiceServer(s grpc.ServiceRegistrar, srv StudentServiceServer) { + // If the following call pancis, it indicates UnimplementedStudentServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&StudentService_ServiceDesc, srv) } @@ -212,79 +172,31 @@ func _StudentService_GetStudentStream_Handler(srv interface{}, stream grpc.Serve if err := stream.RecvMsg(m); err != nil { return err } - return srv.(StudentServiceServer).GetStudentStream(m, &studentServiceGetStudentStreamServer{stream}) -} - -type StudentService_GetStudentStreamServer interface { - Send(*StudentResponse) error - grpc.ServerStream + return srv.(StudentServiceServer).GetStudentStream(m, &grpc.GenericServerStream[StudentRequest, StudentResponse]{ServerStream: stream}) } -type studentServiceGetStudentStreamServer struct { - grpc.ServerStream -} - -func (x *studentServiceGetStudentStreamServer) Send(m *StudentResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_GetStudentStreamServer = grpc.ServerStreamingServer[StudentResponse] func _StudentService_SendStudentStream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(StudentServiceServer).SendStudentStream(&studentServiceSendStudentStreamServer{stream}) + return srv.(StudentServiceServer).SendStudentStream(&grpc.GenericServerStream[StudentRequest, StudentResponse]{ServerStream: stream}) } -type StudentService_SendStudentStreamServer interface { - SendAndClose(*StudentResponse) error - Recv() (*StudentRequest, error) - grpc.ServerStream -} - -type studentServiceSendStudentStreamServer struct { - grpc.ServerStream -} - -func (x *studentServiceSendStudentStreamServer) SendAndClose(m *StudentResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *studentServiceSendStudentStreamServer) Recv() (*StudentRequest, error) { - m := new(StudentRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_SendStudentStreamServer = grpc.ClientStreamingServer[StudentRequest, StudentResponse] func _StudentService_SendAndGetStudentStream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(StudentServiceServer).SendAndGetStudentStream(&studentServiceSendAndGetStudentStreamServer{stream}) -} - -type StudentService_SendAndGetStudentStreamServer interface { - Send(*StudentResponse) error - Recv() (*StudentRequest, error) - grpc.ServerStream -} - -type studentServiceSendAndGetStudentStreamServer struct { - grpc.ServerStream + return srv.(StudentServiceServer).SendAndGetStudentStream(&grpc.GenericServerStream[StudentRequest, StudentResponse]{ServerStream: stream}) } -func (x *studentServiceSendAndGetStudentStreamServer) Send(m *StudentResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *studentServiceSendAndGetStudentStreamServer) Recv() (*StudentRequest, error) { - m := new(StudentRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type StudentService_SendAndGetStudentStreamServer = grpc.BidiStreamingServer[StudentRequest, StudentResponse] // StudentService_ServiceDesc is the grpc.ServiceDesc for StudentService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var StudentService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "dineth.grpc.api.student.StudentService", + ServiceName: "org.apk.student_service.StudentService", HandlerType: (*StudentServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -310,5 +222,5 @@ var StudentService_ServiceDesc = grpc.ServiceDesc{ ClientStreams: true, }, }, - Metadata: "student_default_version.proto", -} \ No newline at end of file + Metadata: "student.proto", +} From a9de55f00ed792f62ff569b19a70cc53c3c02a5d Mon Sep 17 00:00:00 2001 From: sgayangi Date: Thu, 26 Sep 2024 10:08:03 +0530 Subject: [PATCH 3/3] Update default version test files --- .../operator/controllers/dp/api_controller.go | 2 - .../integration/integration/tests/grpc-api.go | 28 ++- .../tests/resources/base/manifests.yaml | 14 +- .../student_default_version/student2.go | 2 +- .../student_default_version.pb.go | 165 ++++++++++-------- .../student_default_version_grpc.pb.go | 125 ++++++------- 6 files changed, 178 insertions(+), 158 deletions(-) diff --git a/adapter/internal/operator/controllers/dp/api_controller.go b/adapter/internal/operator/controllers/dp/api_controller.go index ff64f7e35..206e35a79 100644 --- a/adapter/internal/operator/controllers/dp/api_controller.go +++ b/adapter/internal/operator/controllers/dp/api_controller.go @@ -33,7 +33,6 @@ import ( "strings" "sync" - "github.com/sirupsen/logrus" "github.com/wso2/apk/adapter/config" "github.com/wso2/apk/adapter/internal/controlplane" "github.com/wso2/apk/adapter/internal/discovery/xds" @@ -1517,7 +1516,6 @@ func (apiReconciler *APIReconciler) getAPIForGRPCRoute(ctx context.Context, obj } apiList := &dpv1alpha3.APIList{} - logrus.Info("=============GETTING API FOR GRPC ROUTE================") if err := apiReconciler.client.List(ctx, apiList, &k8client.ListOptions{ FieldSelector: fields.OneTermEqualSelector(grpcRouteAPIIndex, utils.NamespacedName(grpcRoute).String()), diff --git a/test/integration/integration/tests/grpc-api.go b/test/integration/integration/tests/grpc-api.go index 2ddf270d7..dde6b9d88 100644 --- a/test/integration/integration/tests/grpc-api.go +++ b/test/integration/integration/tests/grpc-api.go @@ -21,7 +21,6 @@ import ( "testing" "github.com/wso2/apk/test/integration/integration/utils/grpc-code/student" - "github.com/wso2/apk/test/integration/integration/utils/grpc-code/student_default_version" "github.com/wso2/apk/test/integration/integration/utils/grpcutils" "github.com/wso2/apk/test/integration/integration/utils/suite" ) @@ -37,7 +36,6 @@ var GRPCAPI = suite.IntegrationTest{ Manifests: []string{"tests/grpc-api.yaml"}, Test: func(t *testing.T, suite *suite.IntegrationTestSuite) { gwAddr := "grpc.test.gw.wso2.com:9095" - testCases := []grpcutils.GRPCTestCase{ { ExpectedResponse: grpcutils.ExpectedResponse{ @@ -52,19 +50,19 @@ var GRPCAPI = suite.IntegrationTest{ Method: student.GetStudent, Satisfier: student.StudentResponseSatisfier{}, }, - { - ExpectedResponse: grpcutils.ExpectedResponse{ - Out: &student_default_version.StudentResponse{ - Name: "Student", - Age: 10, - }, - Err: nil, - }, - ActualResponse: &student_default_version.StudentResponse{}, - Name: "Get Student Details (Default API Version)", - Method: student_default_version.GetStudent, - Satisfier: student_default_version.StudentResponseSatisfier{}, - }, + // { + // ExpectedResponse: grpcutils.ExpectedResponse{ + // Out: &student_default_version.StudentResponse{ + // Name: "Student", + // Age: 10, + // }, + // Err: nil, + // }, + // ActualResponse: &student_default_version.StudentResponse{}, + // Name: "Get Student Details (Default API Version)", + // Method: student_default_version.GetStudent, + // Satisfier: student_default_version.StudentResponseSatisfier{}, + // }, } for i := range testCases { tc := testCases[i] diff --git a/test/integration/integration/tests/resources/base/manifests.yaml b/test/integration/integration/tests/resources/base/manifests.yaml index 6c675d5d0..fe5d80efb 100644 --- a/test/integration/integration/tests/resources/base/manifests.yaml +++ b/test/integration/integration/tests/resources/base/manifests.yaml @@ -142,11 +142,23 @@ spec: app: grpc-backend-v1 spec: containers: - - name: grpc-backend + - name: grpc-backend-v1 image: sega1234/student-service:1.0.0 imagePullPolicy: Always ports: - containerPort: 9090 + env: + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + resources: + requests: + cpu: 10m --- apiVersion: v1 kind: Service diff --git a/test/integration/integration/utils/grpc-code/student_default_version/student2.go b/test/integration/integration/utils/grpc-code/student_default_version/student2.go index 9a56a4b6b..bdc9bbd52 100644 --- a/test/integration/integration/utils/grpc-code/student_default_version/student2.go +++ b/test/integration/integration/utils/grpc-code/student_default_version/student2.go @@ -35,7 +35,7 @@ func (srs StudentResponseSatisfier) IsSatisfactory(response any, expectedRespons } } func GetStudent(conn *grpc.ClientConn) (any, error) { - c := NewStudentServiceClient(conn) + c := NewStudentServiceDefaultVersionClient(conn) ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() r := &StudentRequest{Id: 1234} diff --git a/test/integration/integration/utils/grpc-code/student_default_version/student_default_version.pb.go b/test/integration/integration/utils/grpc-code/student_default_version/student_default_version.pb.go index 7871032d8..e4ce2f3d6 100644 --- a/test/integration/integration/utils/grpc-code/student_default_version/student_default_version.pb.go +++ b/test/integration/integration/utils/grpc-code/student_default_version/student_default_version.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.27.1 // protoc v5.28.0 -// source: student.proto +// source: student_default_version.proto package student_default_version @@ -31,7 +31,7 @@ type StudentRequest struct { func (x *StudentRequest) Reset() { *x = StudentRequest{} if protoimpl.UnsafeEnabled { - mi := &file_student_proto_msgTypes[0] + mi := &file_student_default_version_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -44,7 +44,7 @@ func (x *StudentRequest) String() string { func (*StudentRequest) ProtoMessage() {} func (x *StudentRequest) ProtoReflect() protoreflect.Message { - mi := &file_student_proto_msgTypes[0] + mi := &file_student_default_version_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -57,7 +57,7 @@ func (x *StudentRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StudentRequest.ProtoReflect.Descriptor instead. func (*StudentRequest) Descriptor() ([]byte, []int) { - return file_student_proto_rawDescGZIP(), []int{0} + return file_student_default_version_proto_rawDescGZIP(), []int{0} } func (x *StudentRequest) GetId() int32 { @@ -79,7 +79,7 @@ type StudentResponse struct { func (x *StudentResponse) Reset() { *x = StudentResponse{} if protoimpl.UnsafeEnabled { - mi := &file_student_proto_msgTypes[1] + mi := &file_student_default_version_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -92,7 +92,7 @@ func (x *StudentResponse) String() string { func (*StudentResponse) ProtoMessage() {} func (x *StudentResponse) ProtoReflect() protoreflect.Message { - mi := &file_student_proto_msgTypes[1] + mi := &file_student_default_version_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -105,7 +105,7 @@ func (x *StudentResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StudentResponse.ProtoReflect.Descriptor instead. func (*StudentResponse) Descriptor() ([]byte, []int) { - return file_student_proto_rawDescGZIP(), []int{1} + return file_student_default_version_proto_rawDescGZIP(), []int{1} } func (x *StudentResponse) GetName() string { @@ -122,78 +122,89 @@ func (x *StudentResponse) GetAge() int32 { return 0 } -var File_student_proto protoreflect.FileDescriptor +var File_student_default_version_proto protoreflect.FileDescriptor -var file_student_proto_rawDesc = []byte{ - 0x0a, 0x0d, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x17, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, - 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x0a, 0x0e, 0x53, 0x74, 0x75, 0x64, +var file_student_default_version_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x27, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, + 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x0a, 0x0e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x37, 0x0a, 0x0f, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, - 0x61, 0x67, 0x65, 0x32, 0xbe, 0x03, 0x0a, 0x0e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x61, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x74, 0x75, - 0x64, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, - 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, - 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, + 0x61, 0x67, 0x65, 0x32, 0xd0, 0x04, 0x0a, 0x1c, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x81, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x74, 0x75, 0x64, + 0x65, 0x6e, 0x74, 0x12, 0x37, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, + 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, + 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x6f, + 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x89, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, + 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x37, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x69, 0x0a, 0x10, 0x47, 0x65, 0x74, - 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x27, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, + 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x30, 0x01, 0x12, 0x8a, 0x01, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x75, + 0x64, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x37, 0x2e, 0x6f, 0x72, 0x67, + 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, + 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x64, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, + 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, + 0x01, 0x12, 0x92, 0x01, 0x0a, 0x17, 0x53, 0x65, 0x6e, 0x64, 0x41, 0x6e, 0x64, 0x47, 0x65, 0x74, + 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x37, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x30, 0x01, 0x12, 0x6a, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x75, 0x64, - 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x27, 0x2e, 0x6f, 0x72, 0x67, 0x2e, - 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, - 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, - 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, - 0x12, 0x72, 0x0a, 0x17, 0x53, 0x65, 0x6e, 0x64, 0x41, 0x6e, 0x64, 0x47, 0x65, 0x74, 0x53, 0x74, - 0x75, 0x64, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x27, 0x2e, 0x6f, 0x72, - 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, 0x73, - 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, - 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x28, 0x01, 0x30, 0x01, 0x42, 0x38, 0x0a, 0x1a, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, 0x6b, 0x2e, - 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x50, 0x01, 0x5a, 0x18, 0x2f, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x40, 0x0a, 0x1a, 0x6f, 0x72, 0x67, 0x2e, 0x61, 0x70, + 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x50, 0x01, 0x5a, 0x20, 0x2f, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, + 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_student_proto_rawDescOnce sync.Once - file_student_proto_rawDescData = file_student_proto_rawDesc + file_student_default_version_proto_rawDescOnce sync.Once + file_student_default_version_proto_rawDescData = file_student_default_version_proto_rawDesc ) -func file_student_proto_rawDescGZIP() []byte { - file_student_proto_rawDescOnce.Do(func() { - file_student_proto_rawDescData = protoimpl.X.CompressGZIP(file_student_proto_rawDescData) +func file_student_default_version_proto_rawDescGZIP() []byte { + file_student_default_version_proto_rawDescOnce.Do(func() { + file_student_default_version_proto_rawDescData = protoimpl.X.CompressGZIP(file_student_default_version_proto_rawDescData) }) - return file_student_proto_rawDescData -} - -var file_student_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_student_proto_goTypes = []any{ - (*StudentRequest)(nil), // 0: org.apk.student_service.StudentRequest - (*StudentResponse)(nil), // 1: org.apk.student_service.StudentResponse -} -var file_student_proto_depIdxs = []int32{ - 0, // 0: org.apk.student_service.StudentService.GetStudent:input_type -> org.apk.student_service.StudentRequest - 0, // 1: org.apk.student_service.StudentService.GetStudentStream:input_type -> org.apk.student_service.StudentRequest - 0, // 2: org.apk.student_service.StudentService.SendStudentStream:input_type -> org.apk.student_service.StudentRequest - 0, // 3: org.apk.student_service.StudentService.SendAndGetStudentStream:input_type -> org.apk.student_service.StudentRequest - 1, // 4: org.apk.student_service.StudentService.GetStudent:output_type -> org.apk.student_service.StudentResponse - 1, // 5: org.apk.student_service.StudentService.GetStudentStream:output_type -> org.apk.student_service.StudentResponse - 1, // 6: org.apk.student_service.StudentService.SendStudentStream:output_type -> org.apk.student_service.StudentResponse - 1, // 7: org.apk.student_service.StudentService.SendAndGetStudentStream:output_type -> org.apk.student_service.StudentResponse + return file_student_default_version_proto_rawDescData +} + +var file_student_default_version_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_student_default_version_proto_goTypes = []interface{}{ + (*StudentRequest)(nil), // 0: org.apk.student_service_default_version.StudentRequest + (*StudentResponse)(nil), // 1: org.apk.student_service_default_version.StudentResponse +} +var file_student_default_version_proto_depIdxs = []int32{ + 0, // 0: org.apk.student_service_default_version.StudentServiceDefaultVersion.GetStudent:input_type -> org.apk.student_service_default_version.StudentRequest + 0, // 1: org.apk.student_service_default_version.StudentServiceDefaultVersion.GetStudentStream:input_type -> org.apk.student_service_default_version.StudentRequest + 0, // 2: org.apk.student_service_default_version.StudentServiceDefaultVersion.SendStudentStream:input_type -> org.apk.student_service_default_version.StudentRequest + 0, // 3: org.apk.student_service_default_version.StudentServiceDefaultVersion.SendAndGetStudentStream:input_type -> org.apk.student_service_default_version.StudentRequest + 1, // 4: org.apk.student_service_default_version.StudentServiceDefaultVersion.GetStudent:output_type -> org.apk.student_service_default_version.StudentResponse + 1, // 5: org.apk.student_service_default_version.StudentServiceDefaultVersion.GetStudentStream:output_type -> org.apk.student_service_default_version.StudentResponse + 1, // 6: org.apk.student_service_default_version.StudentServiceDefaultVersion.SendStudentStream:output_type -> org.apk.student_service_default_version.StudentResponse + 1, // 7: org.apk.student_service_default_version.StudentServiceDefaultVersion.SendAndGetStudentStream:output_type -> org.apk.student_service_default_version.StudentResponse 4, // [4:8] is the sub-list for method output_type 0, // [0:4] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -201,13 +212,13 @@ var file_student_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_student_proto_init() } -func file_student_proto_init() { - if File_student_proto != nil { +func init() { file_student_default_version_proto_init() } +func file_student_default_version_proto_init() { + if File_student_default_version_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_student_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_student_default_version_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StudentRequest); i { case 0: return &v.state @@ -219,7 +230,7 @@ func file_student_proto_init() { return nil } } - file_student_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_student_default_version_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StudentResponse); i { case 0: return &v.state @@ -236,18 +247,18 @@ func file_student_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_student_proto_rawDesc, + RawDescriptor: file_student_default_version_proto_rawDesc, NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_student_proto_goTypes, - DependencyIndexes: file_student_proto_depIdxs, - MessageInfos: file_student_proto_msgTypes, + GoTypes: file_student_default_version_proto_goTypes, + DependencyIndexes: file_student_default_version_proto_depIdxs, + MessageInfos: file_student_default_version_proto_msgTypes, }.Build() - File_student_proto = out.File - file_student_proto_rawDesc = nil - file_student_proto_goTypes = nil - file_student_proto_depIdxs = nil + File_student_default_version_proto = out.File + file_student_default_version_proto_rawDesc = nil + file_student_default_version_proto_goTypes = nil + file_student_default_version_proto_depIdxs = nil } diff --git a/test/integration/integration/utils/grpc-code/student_default_version/student_default_version_grpc.pb.go b/test/integration/integration/utils/grpc-code/student_default_version/student_default_version_grpc.pb.go index 6bf5503af..40fdc25ee 100644 --- a/test/integration/integration/utils/grpc-code/student_default_version/student_default_version_grpc.pb.go +++ b/test/integration/integration/utils/grpc-code/student_default_version/student_default_version_grpc.pb.go @@ -2,7 +2,7 @@ // versions: // - protoc-gen-go-grpc v1.5.1 // - protoc v5.28.0 -// source: student.proto +// source: student_default_version.proto package student_default_version @@ -19,43 +19,43 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - StudentService_GetStudent_FullMethodName = "/org.apk.student_service.StudentService/GetStudent" - StudentService_GetStudentStream_FullMethodName = "/org.apk.student_service.StudentService/GetStudentStream" - StudentService_SendStudentStream_FullMethodName = "/org.apk.student_service.StudentService/SendStudentStream" - StudentService_SendAndGetStudentStream_FullMethodName = "/org.apk.student_service.StudentService/SendAndGetStudentStream" + StudentServiceDefaultVersion_GetStudent_FullMethodName = "/org.apk.student_service_default_version.StudentServiceDefaultVersion/GetStudent" + StudentServiceDefaultVersion_GetStudentStream_FullMethodName = "/org.apk.student_service_default_version.StudentServiceDefaultVersion/GetStudentStream" + StudentServiceDefaultVersion_SendStudentStream_FullMethodName = "/org.apk.student_service_default_version.StudentServiceDefaultVersion/SendStudentStream" + StudentServiceDefaultVersion_SendAndGetStudentStream_FullMethodName = "/org.apk.student_service_default_version.StudentServiceDefaultVersion/SendAndGetStudentStream" ) -// StudentServiceClient is the client API for StudentService service. +// StudentServiceDefaultVersionClient is the client API for StudentServiceDefaultVersion service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type StudentServiceClient interface { +type StudentServiceDefaultVersionClient interface { GetStudent(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (*StudentResponse, error) GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StudentResponse], error) SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[StudentRequest, StudentResponse], error) SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StudentRequest, StudentResponse], error) } -type studentServiceClient struct { +type studentServiceDefaultVersionClient struct { cc grpc.ClientConnInterface } -func NewStudentServiceClient(cc grpc.ClientConnInterface) StudentServiceClient { - return &studentServiceClient{cc} +func NewStudentServiceDefaultVersionClient(cc grpc.ClientConnInterface) StudentServiceDefaultVersionClient { + return &studentServiceDefaultVersionClient{cc} } -func (c *studentServiceClient) GetStudent(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (*StudentResponse, error) { +func (c *studentServiceDefaultVersionClient) GetStudent(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (*StudentResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(StudentResponse) - err := c.cc.Invoke(ctx, StudentService_GetStudent_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, StudentServiceDefaultVersion_GetStudent_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *studentServiceClient) GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StudentResponse], error) { +func (c *studentServiceDefaultVersionClient) GetStudentStream(ctx context.Context, in *StudentRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StudentResponse], error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[0], StudentService_GetStudentStream_FullMethodName, cOpts...) + stream, err := c.cc.NewStream(ctx, &StudentServiceDefaultVersion_ServiceDesc.Streams[0], StudentServiceDefaultVersion_GetStudentStream_FullMethodName, cOpts...) if err != nil { return nil, err } @@ -70,11 +70,11 @@ func (c *studentServiceClient) GetStudentStream(ctx context.Context, in *Student } // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type StudentService_GetStudentStreamClient = grpc.ServerStreamingClient[StudentResponse] +type StudentServiceDefaultVersion_GetStudentStreamClient = grpc.ServerStreamingClient[StudentResponse] -func (c *studentServiceClient) SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[StudentRequest, StudentResponse], error) { +func (c *studentServiceDefaultVersionClient) SendStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[StudentRequest, StudentResponse], error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[1], StudentService_SendStudentStream_FullMethodName, cOpts...) + stream, err := c.cc.NewStream(ctx, &StudentServiceDefaultVersion_ServiceDesc.Streams[1], StudentServiceDefaultVersion_SendStudentStream_FullMethodName, cOpts...) if err != nil { return nil, err } @@ -83,11 +83,11 @@ func (c *studentServiceClient) SendStudentStream(ctx context.Context, opts ...gr } // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type StudentService_SendStudentStreamClient = grpc.ClientStreamingClient[StudentRequest, StudentResponse] +type StudentServiceDefaultVersion_SendStudentStreamClient = grpc.ClientStreamingClient[StudentRequest, StudentResponse] -func (c *studentServiceClient) SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StudentRequest, StudentResponse], error) { +func (c *studentServiceDefaultVersionClient) SendAndGetStudentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StudentRequest, StudentResponse], error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &StudentService_ServiceDesc.Streams[2], StudentService_SendAndGetStudentStream_FullMethodName, cOpts...) + stream, err := c.cc.NewStream(ctx, &StudentServiceDefaultVersion_ServiceDesc.Streams[2], StudentServiceDefaultVersion_SendAndGetStudentStream_FullMethodName, cOpts...) if err != nil { return nil, err } @@ -96,131 +96,132 @@ func (c *studentServiceClient) SendAndGetStudentStream(ctx context.Context, opts } // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type StudentService_SendAndGetStudentStreamClient = grpc.BidiStreamingClient[StudentRequest, StudentResponse] +type StudentServiceDefaultVersion_SendAndGetStudentStreamClient = grpc.BidiStreamingClient[StudentRequest, StudentResponse] -// StudentServiceServer is the server API for StudentService service. -// All implementations must embed UnimplementedStudentServiceServer +// StudentServiceDefaultVersionServer is the server API for StudentServiceDefaultVersion service. +// All implementations must embed UnimplementedStudentServiceDefaultVersionServer // for forward compatibility. -type StudentServiceServer interface { +type StudentServiceDefaultVersionServer interface { GetStudent(context.Context, *StudentRequest) (*StudentResponse, error) GetStudentStream(*StudentRequest, grpc.ServerStreamingServer[StudentResponse]) error SendStudentStream(grpc.ClientStreamingServer[StudentRequest, StudentResponse]) error SendAndGetStudentStream(grpc.BidiStreamingServer[StudentRequest, StudentResponse]) error - mustEmbedUnimplementedStudentServiceServer() + mustEmbedUnimplementedStudentServiceDefaultVersionServer() } -// UnimplementedStudentServiceServer must be embedded to have +// UnimplementedStudentServiceDefaultVersionServer must be embedded to have // forward compatible implementations. // // NOTE: this should be embedded by value instead of pointer to avoid a nil // pointer dereference when methods are called. -type UnimplementedStudentServiceServer struct{} +type UnimplementedStudentServiceDefaultVersionServer struct{} -func (UnimplementedStudentServiceServer) GetStudent(context.Context, *StudentRequest) (*StudentResponse, error) { +func (UnimplementedStudentServiceDefaultVersionServer) GetStudent(context.Context, *StudentRequest) (*StudentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetStudent not implemented") } -func (UnimplementedStudentServiceServer) GetStudentStream(*StudentRequest, grpc.ServerStreamingServer[StudentResponse]) error { +func (UnimplementedStudentServiceDefaultVersionServer) GetStudentStream(*StudentRequest, grpc.ServerStreamingServer[StudentResponse]) error { return status.Errorf(codes.Unimplemented, "method GetStudentStream not implemented") } -func (UnimplementedStudentServiceServer) SendStudentStream(grpc.ClientStreamingServer[StudentRequest, StudentResponse]) error { +func (UnimplementedStudentServiceDefaultVersionServer) SendStudentStream(grpc.ClientStreamingServer[StudentRequest, StudentResponse]) error { return status.Errorf(codes.Unimplemented, "method SendStudentStream not implemented") } -func (UnimplementedStudentServiceServer) SendAndGetStudentStream(grpc.BidiStreamingServer[StudentRequest, StudentResponse]) error { +func (UnimplementedStudentServiceDefaultVersionServer) SendAndGetStudentStream(grpc.BidiStreamingServer[StudentRequest, StudentResponse]) error { return status.Errorf(codes.Unimplemented, "method SendAndGetStudentStream not implemented") } -func (UnimplementedStudentServiceServer) mustEmbedUnimplementedStudentServiceServer() {} -func (UnimplementedStudentServiceServer) testEmbeddedByValue() {} +func (UnimplementedStudentServiceDefaultVersionServer) mustEmbedUnimplementedStudentServiceDefaultVersionServer() { +} +func (UnimplementedStudentServiceDefaultVersionServer) testEmbeddedByValue() {} -// UnsafeStudentServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to StudentServiceServer will +// UnsafeStudentServiceDefaultVersionServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to StudentServiceDefaultVersionServer will // result in compilation errors. -type UnsafeStudentServiceServer interface { - mustEmbedUnimplementedStudentServiceServer() +type UnsafeStudentServiceDefaultVersionServer interface { + mustEmbedUnimplementedStudentServiceDefaultVersionServer() } -func RegisterStudentServiceServer(s grpc.ServiceRegistrar, srv StudentServiceServer) { - // If the following call pancis, it indicates UnimplementedStudentServiceServer was +func RegisterStudentServiceDefaultVersionServer(s grpc.ServiceRegistrar, srv StudentServiceDefaultVersionServer) { + // If the following call pancis, it indicates UnimplementedStudentServiceDefaultVersionServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { t.testEmbeddedByValue() } - s.RegisterService(&StudentService_ServiceDesc, srv) + s.RegisterService(&StudentServiceDefaultVersion_ServiceDesc, srv) } -func _StudentService_GetStudent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _StudentServiceDefaultVersion_GetStudent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StudentRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(StudentServiceServer).GetStudent(ctx, in) + return srv.(StudentServiceDefaultVersionServer).GetStudent(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: StudentService_GetStudent_FullMethodName, + FullMethod: StudentServiceDefaultVersion_GetStudent_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StudentServiceServer).GetStudent(ctx, req.(*StudentRequest)) + return srv.(StudentServiceDefaultVersionServer).GetStudent(ctx, req.(*StudentRequest)) } return interceptor(ctx, in, info, handler) } -func _StudentService_GetStudentStream_Handler(srv interface{}, stream grpc.ServerStream) error { +func _StudentServiceDefaultVersion_GetStudentStream_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(StudentRequest) if err := stream.RecvMsg(m); err != nil { return err } - return srv.(StudentServiceServer).GetStudentStream(m, &grpc.GenericServerStream[StudentRequest, StudentResponse]{ServerStream: stream}) + return srv.(StudentServiceDefaultVersionServer).GetStudentStream(m, &grpc.GenericServerStream[StudentRequest, StudentResponse]{ServerStream: stream}) } // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type StudentService_GetStudentStreamServer = grpc.ServerStreamingServer[StudentResponse] +type StudentServiceDefaultVersion_GetStudentStreamServer = grpc.ServerStreamingServer[StudentResponse] -func _StudentService_SendStudentStream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(StudentServiceServer).SendStudentStream(&grpc.GenericServerStream[StudentRequest, StudentResponse]{ServerStream: stream}) +func _StudentServiceDefaultVersion_SendStudentStream_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(StudentServiceDefaultVersionServer).SendStudentStream(&grpc.GenericServerStream[StudentRequest, StudentResponse]{ServerStream: stream}) } // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type StudentService_SendStudentStreamServer = grpc.ClientStreamingServer[StudentRequest, StudentResponse] +type StudentServiceDefaultVersion_SendStudentStreamServer = grpc.ClientStreamingServer[StudentRequest, StudentResponse] -func _StudentService_SendAndGetStudentStream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(StudentServiceServer).SendAndGetStudentStream(&grpc.GenericServerStream[StudentRequest, StudentResponse]{ServerStream: stream}) +func _StudentServiceDefaultVersion_SendAndGetStudentStream_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(StudentServiceDefaultVersionServer).SendAndGetStudentStream(&grpc.GenericServerStream[StudentRequest, StudentResponse]{ServerStream: stream}) } // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type StudentService_SendAndGetStudentStreamServer = grpc.BidiStreamingServer[StudentRequest, StudentResponse] +type StudentServiceDefaultVersion_SendAndGetStudentStreamServer = grpc.BidiStreamingServer[StudentRequest, StudentResponse] -// StudentService_ServiceDesc is the grpc.ServiceDesc for StudentService service. +// StudentServiceDefaultVersion_ServiceDesc is the grpc.ServiceDesc for StudentServiceDefaultVersion service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var StudentService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.apk.student_service.StudentService", - HandlerType: (*StudentServiceServer)(nil), +var StudentServiceDefaultVersion_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "org.apk.student_service_default_version.StudentServiceDefaultVersion", + HandlerType: (*StudentServiceDefaultVersionServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetStudent", - Handler: _StudentService_GetStudent_Handler, + Handler: _StudentServiceDefaultVersion_GetStudent_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "GetStudentStream", - Handler: _StudentService_GetStudentStream_Handler, + Handler: _StudentServiceDefaultVersion_GetStudentStream_Handler, ServerStreams: true, }, { StreamName: "SendStudentStream", - Handler: _StudentService_SendStudentStream_Handler, + Handler: _StudentServiceDefaultVersion_SendStudentStream_Handler, ClientStreams: true, }, { StreamName: "SendAndGetStudentStream", - Handler: _StudentService_SendAndGetStudentStream_Handler, + Handler: _StudentServiceDefaultVersion_SendAndGetStudentStream_Handler, ServerStreams: true, ClientStreams: true, }, }, - Metadata: "student.proto", + Metadata: "student_default_version.proto", }