public class ServiceClientTestClassComposer extends AbstractServiceClientTestClassComposer
CLIENT_VAR_NAME, EMPTY_LINE_STATEMENT, FIXED_TYPESTORE, TEST_ANNOTATION| Modifier | Constructor and Description |
|---|---|
protected |
ServiceClientTestClassComposer() |
createRpcExceptionTestStatements, createUnsupportedTestMethod, generate, generate, getCallableMethodName, getCallableType, getTransportContext, isSupportedMethodpublic static AbstractServiceClientTestClassComposer instance()
protected Map<String,VariableExpr> createClassMemberVarExprs(Service service, GapicContext context, TypeStore typeStore)
createClassMemberVarExprs in class AbstractServiceClientTestClassComposerprotected List<Statement> createClassMemberFieldDecls(Map<String,VariableExpr> classMemberVarExprs)
createClassMemberFieldDecls in class AbstractServiceClientTestClassComposerprotected MethodDefinition createStartStaticServerMethod(Service service, GapicContext context, Map<String,VariableExpr> classMemberVarExprs, TypeStore typeStore, String newBuilderMethod)
createStartStaticServerMethod in class AbstractServiceClientTestClassComposerprotected MethodDefinition createStopServerMethod(Service service, Map<String,VariableExpr> classMemberVarExprs)
createStopServerMethod in class AbstractServiceClientTestClassComposerprotected MethodDefinition createSetUpMethod(Service service, Map<String,VariableExpr> classMemberVarExprs, TypeStore typeStore)
createSetUpMethod in class AbstractServiceClientTestClassComposerprotected MethodDefinition createTearDownMethod(Service service, Map<String,VariableExpr> classMemberVarExprs)
createTearDownMethod in class AbstractServiceClientTestClassComposerprotected List<Statement> constructRpcTestCheckerLogic(Method method, List<MethodArgument> methodSignature, Service service, boolean isRequestArg, Map<String,VariableExpr> classMemberVarExprs, VariableExpr requestVarExpr, Message requestMessage)
constructRpcTestCheckerLogic in class AbstractServiceClientTestClassComposerprotected MethodDefinition createStreamingRpcTestMethod(Service service, Method method, Map<String,VariableExpr> classMemberVarExprs, Map<String,ResourceName> resourceNames, Map<String,Message> messageTypes)
createStreamingRpcTestMethod in class AbstractServiceClientTestClassComposerprotected MethodDefinition createRpcExceptionTestMethod(Method method, Service service, List<MethodArgument> methodSignature, int variantIndex, Map<String,VariableExpr> classMemberVarExprs, Map<String,ResourceName> resourceNames, Map<String,Message> messageTypes)
AbstractServiceClientTestClassComposercreateRpcExceptionTestMethod in class AbstractServiceClientTestClassComposermethod - the RPC for which this test method is created.service - the service that method belongs 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.protected List<Statement> createStreamingRpcExceptionTestStatements(Method method, Map<String,VariableExpr> classMemberVarExprs, Map<String,ResourceName> resourceNames, Map<String,Message> messageTypes)
createStreamingRpcExceptionTestStatements in class AbstractServiceClientTestClassComposerprotected List<Statement> createRpcLroExceptionTestCatchBody(VariableExpr exceptionExpr, boolean isStreaming)
createRpcLroExceptionTestCatchBody in class AbstractServiceClientTestClassComposerprotected String getMockServiceVarName(Service service)
getMockServiceVarName in class AbstractServiceClientTestClassComposerCopyright © 2022 Google LLC. All rights reserved.