From 7cb07d4d5abca4c1dce9c96fa2369bdba020f61e Mon Sep 17 00:00:00 2001 From: Nikitin Aleksandr Date: Thu, 9 Nov 2023 16:43:45 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20model=5F?= =?UTF-8?q?crud.go=5F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../internal/server_grpc/server_grpc_test.go_ | 10 +++++++--- .../pkg/network/grpc/grpc_client/grpc_client_test.go_ | 4 ++++ .../pkg/network/nrpc/nrpc_client/nrpc_client_test.go_ | 4 ++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/bin/templates/internal/server_grpc/server_grpc_test.go_ b/bin/templates/internal/server_grpc/server_grpc_test.go_ index 330ab06..82c4deb 100644 --- a/bin/templates/internal/server_grpc/server_grpc_test.go_ +++ b/bin/templates/internal/server_grpc/server_grpc_test.go_ @@ -164,14 +164,18 @@ func Test_server_LawsuitStatusType_FindByExtID(t *testing.T) { server1 := &ServerGRPC{} Otvet1, err := server1.LawsuitStatusType_Read(ctx, &Request) if err != nil { - t.Error("Test_server_LawsuitStatusType_FindByExtId() error: ", err) + t.Error("Test_server_LawsuitStatusType_FindByExtID() error: ", err) } // получим модель из строки JSON Model := lawsuit_status_types.LawsuitStatusType{} err = Model.GetModelFromJSON(Otvet1.ModelString) if err != nil { - t.Error("Test_server_LawsuitStatusType_FindByExtId() GetModelFromJSON() error: ", err) + t.Error("Test_server_LawsuitStatusType_FindByExtID() GetModelFromJSON() error: ", err) + } + + if Model.ExtID == 0 { + return } @@ -181,7 +185,7 @@ func Test_server_LawsuitStatusType_FindByExtID(t *testing.T) { RequestExtId.ConnectionId = Model.ConnectionID RequestExtId.VersionModel = lawsuit_status_types.LawsuitStatusType{}.GetStructVersion() - Otvet, err := server1.LawsuitStatusType_FindByExtId(ctx, &RequestExtId) + Otvet, err := server1.LawsuitStatusType_FindByExtID(ctx, &RequestExtId) if err != nil { t.Error("Test_server_LawsuitStatusType_FindByExtId() error: ", err) } diff --git a/bin/templates/pkg/network/grpc/grpc_client/grpc_client_test.go_ b/bin/templates/pkg/network/grpc/grpc_client/grpc_client_test.go_ index 9de1936..317fb71 100644 --- a/bin/templates/pkg/network/grpc/grpc_client/grpc_client_test.go_ +++ b/bin/templates/pkg/network/grpc/grpc_client/grpc_client_test.go_ @@ -165,6 +165,10 @@ func TestFindByExtID(t *testing.T) { t.Error("TestFind_ByExtID() error: ", err) } + if Otvet1.ExtID == 0 { + return + } + Otvet := lawsuit_status_types.LawsuitStatusType{} Otvet.ExtID = Otvet1.ExtID Otvet.ConnectionID = Otvet1.ConnectionID diff --git a/bin/templates/pkg/network/nrpc/nrpc_client/nrpc_client_test.go_ b/bin/templates/pkg/network/nrpc/nrpc_client/nrpc_client_test.go_ index bf0c758..b360493 100644 --- a/bin/templates/pkg/network/nrpc/nrpc_client/nrpc_client_test.go_ +++ b/bin/templates/pkg/network/nrpc/nrpc_client/nrpc_client_test.go_ @@ -165,6 +165,10 @@ func TestFindByExtID(t *testing.T) { t.Error("TestFind_ByExtID() error: ", err) } + if Otvet1.ExtID == 0 { + return + } + Otvet := lawsuit_status_types.LawsuitStatusType{} Otvet.ExtID = Otvet1.ExtID Otvet.ConnectionID = Otvet1.ConnectionID