public class RPCEndpointsBuilder extends Object
| Constructor and Description |
|---|
RPCEndpointsBuilder() |
| Modifier and Type | Method and Description |
|---|---|
static InterfaceSchema |
build(String interfaceName,
RPCType rpcType,
Object client,
List<String> skipEndpointsByName,
List<String> skipEndpointsByAnnotation,
List<String> involveEndpointsByName,
List<String> involveEndpointsByAnnotation,
List<AuthenticationDto> authenticationDtoList,
List<CustomizedRequestValueDto> customizedRequestValueDtos,
List<CustomizedNotNullAnnotationForRPCDto> notNullAnnotations) |
static NamedTypedValue |
buildDbExternalServiceResponse(InterfaceSchema schema,
MockDatabaseDto dbDto,
RPCType rpcType)
identify return datatype for database as external services
|
static NamedTypedValue |
buildExternalServiceResponse(InterfaceSchema schema,
MockRPCExternalServiceDto apiDto,
RPCType rpcType)
identify return datatype for API services as external services
|
static Map<Integer,LocalAuthSetupSchema> |
buildLocalAuthSetup(List<AuthenticationDto> authenticationDtoList)
build the local auth setup
|
static Map<String,List<RPCActionDto>> |
buildSeededTest(Map<String,InterfaceSchema> rpcInterfaceSchema,
List<SeededRPCTestDto> seedRPCTests,
RPCType rpcType) |
static void |
handleExternalResponses(InterfaceSchema schema,
SeededRPCActionDto actionDto,
RPCType type) |
static void |
validateCustomizedNotNullAnnotationForRPCDto(List<CustomizedNotNullAnnotationForRPCDto> notNullAnnotations)
validate specified notNullAnnotations
|
static void |
validateCustomizedValueInRequests(List<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
|
public static void validateCustomizedValueInRequests(List<CustomizedRequestValueDto> customizedRequestValueDtos)
customizedRequestValueDtos - are customized info to be checkedpublic static void validateCustomizedNotNullAnnotationForRPCDto(List<CustomizedNotNullAnnotationForRPCDto> notNullAnnotations)
notNullAnnotations - are specified customized annotation representing if any field of RPC dto is requiredpublic static void handleExternalResponses(InterfaceSchema schema, SeededRPCActionDto actionDto, RPCType type)
public static NamedTypedValue buildExternalServiceResponse(InterfaceSchema schema, MockRPCExternalServiceDto apiDto, RPCType rpcType)
public static NamedTypedValue buildDbExternalServiceResponse(InterfaceSchema schema, MockDatabaseDto dbDto, RPCType rpcType)
public static InterfaceSchema build(String interfaceName, RPCType rpcType, Object client, List<String> skipEndpointsByName, List<String> skipEndpointsByAnnotation, List<String> involveEndpointsByName, List<String> involveEndpointsByAnnotation, List<AuthenticationDto> authenticationDtoList, List<CustomizedRequestValueDto> customizedRequestValueDtos, List<CustomizedNotNullAnnotationForRPCDto> notNullAnnotations)
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 requestspublic static Map<Integer,LocalAuthSetupSchema> buildLocalAuthSetup(List<AuthenticationDto> authenticationDtoList)
authenticationDtoList - a list of auth info specified by userpublic static Map<String,List<RPCActionDto>> buildSeededTest(Map<String,InterfaceSchema> rpcInterfaceSchema, List<SeededRPCTestDto> seedRPCTests, RPCType rpcType)
Copyright © 2016–2023. All rights reserved.