use of com.google.api.codegen.viewmodel.testing.ClientInitParamView in project toolkit by googleapis.
the class RubyGapicSurfaceTestTransformer method createUnitTestClassView.
private ClientTestClassView createUnitTestClassView(GapicInterfaceContext context, boolean packageHasMultipleServices) {
SurfaceNamer namer = context.getNamer();
String apiSettingsClassName = namer.getNotImplementedString("RubyGapicSurfaceTestTransformer.generateUnitTestClassView - apiSettingsClassName");
String testClassName = namer.getNotImplementedString("RubyGapicSurfaceTestTransformer.generateUnitTestClassView - name");
ImmutableList.Builder<ClientInitParamView> clientInitOptionalParams = ImmutableList.builder();
if (RubyUtil.hasMajorVersion(context.getProductConfig().getPackageName())) {
clientInitOptionalParams.add(ClientInitParamView.newBuilder().key("version").value(":" + packageConfig.apiVersion()).build());
}
return ClientTestClassView.newBuilder().apiSettingsClassName(apiSettingsClassName).apiClassName(namer.getFullyQualifiedApiWrapperClassName(context.getInterfaceConfig())).name(testClassName).testCases(createUnitTestCaseViews(context, packageHasMultipleServices)).apiHasLongRunningMethods(context.getInterfaceConfig().hasLongRunningOperations()).missingDefaultServiceAddress(!context.getInterfaceConfig().hasDefaultServiceAddress()).missingDefaultServiceScopes(!context.getInterfaceConfig().hasDefaultServiceScopes()).mockCredentialsClassName(namer.getMockCredentialsClassName(context.getInterface())).fullyQualifiedCredentialsClassName(namer.getFullyQualifiedCredentialsClassName()).clientInitOptionalParams(clientInitOptionalParams.build()).mockServices(ImmutableList.<MockServiceUsageView>of()).build();
}
Aggregations