Class RPCEndpointsBuilder
java.lang.Object
org.evomaster.client.java.controller.problem.rpc.RPCEndpointsBuilder
created by manzhang on 2021/11/4
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InterfaceSchemabuild(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) static NamedTypedValuebuildDbExternalServiceResponse(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 servicesstatic NamedTypedValuebuildExternalServiceResponse(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 servicesstatic Map<Integer,LocalAuthSetupSchema> buildLocalAuthSetup(List<org.evomaster.client.java.controller.api.dto.auth.AuthenticationDto> authenticationDtoList) build the local auth setupbuildSeededTestWithRPCFunctions(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) static voidhandleExternalResponses(InterfaceSchema schema, org.evomaster.client.java.controller.api.dto.problem.rpc.SeededRPCActionDto actionDto, org.evomaster.client.java.controller.api.dto.problem.rpc.RPCType type) static voidvalidateCustomizedNotNullAnnotationForRPCDto(List<CustomizedNotNullAnnotationForRPCDto> notNullAnnotations) validate specified notNullAnnotationsstatic voidvalidateCustomizedValueInRequests(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
-
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 interfacerpcType- is the type of RPC, e.g., gRPC, Thriftclient- is the corresponding client to maniplute the interfaceskipEndpointsByName- specifies a list of names of endpoints to be skipped during testingskipEndpointsByAnnotation- specifies a list of annotations applied on endpoints that could be skipped during testinginvolveEndpointsByName- specifies a list of names of endpoints to be involved during testinginvolveEndpointsByAnnotation- specifies a list of annotations applied on endpoints that are involved during testingauthenticationDtoList- specifies a list of authentication infocustomizedRequestValueDtos- 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)
-