MCPcopy
hub / github.com/keploy/keploy / TestProtoWireToJSONWithAnyTypes

Function TestProtoWireToJSONWithAnyTypes

utils/grpc_test.go:12–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestProtoWireToJSONWithAnyTypes(t *testing.T) {
13 // This test verifies that the Any type resolution works correctly
14 logger := zap.NewNop()
15
16 // Test with a proto that includes Any fields
17 pc := models.ProtoConfig{
18 ProtoFile: "test.proto", // This would be the path to your proto file
19 ProtoInclude: []string{},
20 RequestURI: "/fuzz.FuzzService/EchoAny",
21 }
22
23 // Skip the actual test if we don't have the proto file in the test environment
24 // In a real scenario, you would have the test proto file available
25 _, _, err := GetProtoMessageDescriptor(context.Background(), logger, pc)
26 if err != nil {
27 t.Skipf("Skipping test because proto file not available: %v", err)
28 return
29 }
30
31 // If we had the proto file, we would continue with:
32 // - Create a wire format message with Any fields
33 // - Call ProtoWireToJSON with the message descriptor and files
34 // - Verify that Any types are properly resolved and converted to JSON
35}
36
37func TestCreateTypeResolver(t *testing.T) {
38 // Test that the type resolver creation doesn't panic with nil input

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected