Class GrpcProtoDescriptorStore

java.lang.Object
org.mockserver.grpc.GrpcProtoDescriptorStore

public class GrpcProtoDescriptorStore extends Object
  • Constructor Details

    • GrpcProtoDescriptorStore

      public GrpcProtoDescriptorStore(MockServerLogger mockServerLogger)
  • Method Details

    • loadDescriptorSet

      public void loadDescriptorSet(byte[] descriptorSetBytes)
    • loadDescriptorSetFromPath

      public void loadDescriptorSetFromPath(Path path)
    • loadDescriptorDirectory

      public void loadDescriptorDirectory(Path directory)
    • getService

      public com.google.protobuf.Descriptors.ServiceDescriptor getService(String fullName)
    • getMethod

      public com.google.protobuf.Descriptors.MethodDescriptor getMethod(String serviceName, String methodName)
    • getAllServices

      public Map<String,com.google.protobuf.Descriptors.ServiceDescriptor> getAllServices()
    • getConverter

      public GrpcJsonMessageConverter getConverter()
    • getExampleSynthesizer

      public GrpcExampleSynthesizer getExampleSynthesizer()
    • synthesizeResponseJson

      public String synthesizeResponseJson(String serviceName, String methodName)
      Synthesize a schema-valid protobuf-JSON example for the output (response) message of the supplied service/method, using the loaded descriptors. Returns null when the method is unknown, so the caller can fall back to existing behaviour.

      This backs the "no hand-authored body" path: a matched gRPC expectation whose response has no explicit body can return this synthesized message instead of an empty response.

    • hasServices

      public boolean hasServices()
    • removeService

      public void removeService(String fullName)
    • reset

      public void reset()