Class ServiceClientTestClassComposer
- java.lang.Object
-
- com.google.api.generator.gapic.composer.common.AbstractServiceClientTestClassComposer
-
- com.google.api.generator.gapic.composer.grpc.ServiceClientTestClassComposer
-
- All Implemented Interfaces:
ClassComposer
public class ServiceClientTestClassComposer extends AbstractServiceClientTestClassComposer
-
-
Field Summary
-
Fields inherited from class com.google.api.generator.gapic.composer.common.AbstractServiceClientTestClassComposer
CLIENT_VAR_NAME, EMPTY_LINE_STATEMENT, FIXED_TYPESTORE, TEST_ANNOTATION
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedServiceClientTestClassComposer()
-
Method Summary
-
Methods inherited from class com.google.api.generator.gapic.composer.common.AbstractServiceClientTestClassComposer
createClassMemberFieldDecls, createRpcExceptionTestStatements, createUnsupportedTestMethod, generate, generate, getCallableMethodName, getCallableType, getMockServiceVarName, getTransportContext
-
-
-
-
Method Detail
-
instance
public static AbstractServiceClientTestClassComposer instance()
-
createClassMemberVarExprs
protected Map<String,VariableExpr> createClassMemberVarExprs(Service service, GapicContext context, TypeStore typeStore)
- Specified by:
createClassMemberVarExprsin classAbstractServiceClientTestClassComposer
-
createStartStaticServerMethod
protected MethodDefinition createStartStaticServerMethod(Service service, GapicContext context, Map<String,VariableExpr> classMemberVarExprs, TypeStore typeStore, String newBuilderMethod)
- Specified by:
createStartStaticServerMethodin classAbstractServiceClientTestClassComposer
-
createStopServerMethod
protected MethodDefinition createStopServerMethod(Service service, Map<String,VariableExpr> classMemberVarExprs)
- Specified by:
createStopServerMethodin classAbstractServiceClientTestClassComposer
-
createSetUpMethod
protected MethodDefinition createSetUpMethod(Service service, Map<String,VariableExpr> classMemberVarExprs, TypeStore typeStore)
- Specified by:
createSetUpMethodin classAbstractServiceClientTestClassComposer
-
createTearDownMethod
protected MethodDefinition createTearDownMethod(Service service, Map<String,VariableExpr> classMemberVarExprs)
- Specified by:
createTearDownMethodin classAbstractServiceClientTestClassComposer
-
constructRpcTestCheckerLogic
protected List<Statement> constructRpcTestCheckerLogic(Method method, List<MethodArgument> methodSignature, Service service, boolean isRequestArg, Map<String,VariableExpr> classMemberVarExprs, VariableExpr requestVarExpr, Message requestMessage)
- Specified by:
constructRpcTestCheckerLogicin classAbstractServiceClientTestClassComposer
-
createStreamingRpcTestMethod
protected MethodDefinition createStreamingRpcTestMethod(Service service, Method method, Map<String,VariableExpr> classMemberVarExprs, Map<String,ResourceName> resourceNames, Map<String,Message> messageTypes)
- Specified by:
createStreamingRpcTestMethodin classAbstractServiceClientTestClassComposer
-
createRpcExceptionTestMethod
protected MethodDefinition createRpcExceptionTestMethod(Method method, Service service, List<MethodArgument> methodSignature, int variantIndex, Map<String,VariableExpr> classMemberVarExprs, Map<String,ResourceName> resourceNames, Map<String,Message> messageTypes)
Description copied from class:AbstractServiceClientTestClassComposerCreates a test method to exercise exceptions for a given RPC, e.g. createAssetTest.- Specified by:
createRpcExceptionTestMethodin classAbstractServiceClientTestClassComposer- Parameters:
method- the RPC for which this test method is created.service- the service thatmethodbelongs to.methodSignature- the method signature of the RPC under test.variantIndex- the nth variant of the RPC under test. This applies when we have polymorphism due to the presence of several method signature annotations in the proto.classMemberVarExprs- the class members in the generated test class.resourceNames- the resource names available for use.messageTypes- the proto message types available for use.
-
createStreamingRpcExceptionTestStatements
protected List<Statement> createStreamingRpcExceptionTestStatements(Method method, Map<String,VariableExpr> classMemberVarExprs, Map<String,ResourceName> resourceNames, Map<String,Message> messageTypes)
- Specified by:
createStreamingRpcExceptionTestStatementsin classAbstractServiceClientTestClassComposer
-
createRpcLroExceptionTestCatchBody
protected List<Statement> createRpcLroExceptionTestCatchBody(VariableExpr exceptionExpr, boolean isStreaming)
- Specified by:
createRpcLroExceptionTestCatchBodyin classAbstractServiceClientTestClassComposer
-
-