Class RPCEndpointsBuilder

java.lang.Object
org.evomaster.client.java.controller.problem.rpc.RPCEndpointsBuilder

public class RPCEndpointsBuilder extends Object
created by manzhang on 2021/11/4
  • Constructor Details

    • RPCEndpointsBuilder

      public RPCEndpointsBuilder()
  • Method Details

    • validateCustomizedValueInRequests

      public static void validateCustomizedValueInRequests(List<org.evomaster.client.java.controller.api.dto.CustomizedRequestValueDto> customizedRequestValueDtos)
      validate CustomizedRequestValueDto, eg, 1) for any CustomizedRequestValueDto, keyValuePairs and keyValues could not be specified or null at the same time 2) for keyValuePairs, if annotationOnEndpoint or specificEndpointName or specificRequestTypeName are specified, they should have consistent keys 3) keyValues with respect to any specific annotationOnEndpoint or specificEndpointName or specificRequestTypeName should be specified only one time
      Parameters:
      customizedRequestValueDtos - are customized info to be checked
    • validateCustomizedNotNullAnnotationForRPCDto

      public static void validateCustomizedNotNullAnnotationForRPCDto(List<CustomizedNotNullAnnotationForRPCDto> notNullAnnotations)
      validate specified notNullAnnotations
      Parameters:
      notNullAnnotations - are specified customized annotation representing if any field of RPC dto is required
    • handleExternalResponses

      public static void handleExternalResponses(InterfaceSchema schema, org.evomaster.client.java.controller.api.dto.problem.rpc.SeededRPCActionDto actionDto, org.evomaster.client.java.controller.api.dto.problem.rpc.RPCType type)
    • buildExternalServiceResponse

      public static NamedTypedValue buildExternalServiceResponse(InterfaceSchema schema, org.evomaster.client.java.controller.api.dto.problem.rpc.MockRPCExternalServiceDto apiDto, org.evomaster.client.java.controller.api.dto.problem.rpc.RPCType rpcType)
      identify return datatype for API services as external services
      Returns:
      identified datatype
    • buildDbExternalServiceResponse

      public static NamedTypedValue buildDbExternalServiceResponse(InterfaceSchema schema, org.evomaster.client.java.controller.api.dto.MockDatabaseDto dbDto, org.evomaster.client.java.controller.api.dto.problem.rpc.RPCType rpcType)
      identify return datatype for database as external services
      Returns:
      identified datatype
    • build

      public static InterfaceSchema build(String interfaceName, org.evomaster.client.java.controller.api.dto.problem.rpc.RPCType rpcType, Object client, List<String> skipEndpointsByName, List<String> skipEndpointsByAnnotation, List<String> involveEndpointsByName, List<String> involveEndpointsByAnnotation, List<org.evomaster.client.java.controller.api.dto.auth.AuthenticationDto> authenticationDtoList, List<org.evomaster.client.java.controller.api.dto.CustomizedRequestValueDto> customizedRequestValueDtos, List<CustomizedNotNullAnnotationForRPCDto> notNullAnnotations)
      Parameters:
      interfaceName - the name of interface
      rpcType - is the type of RPC, e.g., gRPC, Thrift
      client - is the corresponding client to maniplute the interface
      skipEndpointsByName - specifies a list of names of endpoints to be skipped during testing
      skipEndpointsByAnnotation - specifies a list of annotations applied on endpoints that could be skipped during testing
      involveEndpointsByName - specifies a list of names of endpoints to be involved during testing
      involveEndpointsByAnnotation - specifies a list of annotations applied on endpoints that are involved during testing
      authenticationDtoList - specifies a list of authentication info
      customizedRequestValueDtos - specifies a list of candidate values in requests
      Returns:
      an interface schema for evomaster to access
    • buildLocalAuthSetup

      public static Map<Integer,LocalAuthSetupSchema> buildLocalAuthSetup(List<org.evomaster.client.java.controller.api.dto.auth.AuthenticationDto> authenticationDtoList)
      build the local auth setup
      Parameters:
      authenticationDtoList - a list of auth info specified by user
      Returns:
      a map of such local auth setup key - index at a list of auth info specified by user value - local endpoint
    • buildSeededTestWithRPCFunctions

      public static Map<String,org.evomaster.client.java.controller.api.dto.problem.rpc.RPCTestDto> buildSeededTestWithRPCFunctions(Map<String,InterfaceSchema> rpcInterfaceSchema, List<org.evomaster.client.java.controller.api.dto.problem.rpc.SeededRPCTestDto> seedRPCTests, org.evomaster.client.java.controller.api.dto.problem.rpc.RPCType rpcType)