Skip to content

Grpc: breaking changes from 1.6.11 to 1.6.12 #1280

@GomesNayagam

Description

@GomesNayagam

Describe the bug @StefH

Unimplemented error because, the response string is not matching.

Expected behavior:

Should deserialize response string and no error, All works if i revert the package to 1.6.8.

Test to reproduce

            var protoBufJsonMatcher5 = new JsonPartialWildcardMatcher(
                "{\"Client\":{\"CorrelationId\":\"*\"}}",
                false,
                true
            );

            var res3 = JsonConvert.DeserializeObject(
                "{\"Status\":{\"HasErrors\":false,\"HasWarnings\":false,\"Errors\":[],\"Warnings\":[],\"CorrelationId\":\"b8ad0d04-ed2f-42e1-ac85-339d91dc9855\"},\"CancellationCode\":\"\",\"CancellationName\":\"\",\"CancellationDescription\":\"\",\"CancellationEffDate\":null,\"NonRenewalCode\":\"\",\"NonRenewalName\":\"\",\"NonRenewalDescription\":\"\",\"NonRenewalEffDate\":null,\"LastReinstatementDate\":null}"
                );

            server
                //.AddProtoDefinition(id, protoDefinitionText)
                .Given(
                    Request
                        .Create()
                        .UsingPost()
                        .WithHttpVersion("2")
                        .WithPath("/Policy2.PolicyService2/GetCancellationDetail")
                        .WithBodyAsProtoBuf(
                            protoDefinition,
                            "Policy2.GetCancellationDetailRequest",
                            protoBufJsonMatcher5
                        )
                )
                .WithProtoDefinition(id)
                .RespondWith(
                    Response
                        .Create()
                        .WithHeader("Content-Type", "application/grpc")
                        .WithTrailingHeader("grpc-status", "0")
                        .WithBodyAsProtoBuf(
                            protoDefinition,
                            "Policy2.GetCancellationDetailResponse",
                            res3!
                        )
                        .WithTransformer()
                );


            var reply4 = await client.GetCancellationDetailAsync(
                new Policy2.GetCancellationDetailRequest { Client = cl }
            );

Other related info

.proto file:

syntax = "proto3";

import "google/protobuf/timestamp.proto";

// option csharp_namespace = "NarrowIntegrationTest.Lookup";

package Policy2;

service PolicyService2 {	
    rpc GetVersion (GetVersionRequest) returns (GetVersionResponse);
	rpc GetVersion2 (GetVersion2Request) returns (GetVersion2Response);
    rpc GetHolidayCalendar (GetHolidayCalendarRequest) returns (GetHolidayCalendarResponse);
	rpc GetCancellationDetail (GetCancellationDetailRequest) returns (GetCancellationDetailResponse);
}

// REQUEST/RESPONSE DEFINITIONS

message GetCancellationDetailRequest {
	Client Client = 1;
	LegacyPolicyKey LegacyPolicyKey = 2;
}

message GetCancellationDetailResponse {
	ResponseStatus Status = 1;
	string CancellationCode = 2;
	string CancellationName = 3;
	string CancellationDescription = 4;
	google.protobuf.Timestamp CancellationEffDate = 5;
	string NonRenewalCode = 6;
	string NonRenewalName = 7;
	string NonRenewalDescription = 8;
	google.protobuf.Timestamp NonRenewalEffDate = 9;
	google.protobuf.Timestamp LastReinstatementDate = 10; // Always send the last reinstatement date if present on the policy term.
}

message LegacyPolicyKey {
	string Group = 1;
	int32 UnitNumber = 2;
	int32 Year = 3;
	string Suffix = 4;
}


message ResponseStatus {
	bool HasErrors = 1;
	bool HasWarnings =2;
	repeated string Errors = 3;
	repeated string Warnings = 4;
	string CorrelationId = 5;

}

message Client {
	string CorrelationId = 1;
	enum Clients {
		Unknown = 0;
        QMS = 1;
        BillingCenter = 2;
        PAS = 3;
        Payroll = 4;
        Portal = 5;
        SFO = 6;
        QuoteAndBind = 7;
        LegacyConversion = 8;
        BindNow = 9;
		PaymentPortal = 10 ;
		PricingEngine = 11;
	}
	Clients ClientName = 2;
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions