Search in sources :

Example 1 with ClientInitParamView

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();
}
Also used : MockServiceUsageView(com.google.api.codegen.viewmodel.testing.MockServiceUsageView) ClientInitParamView(com.google.api.codegen.viewmodel.testing.ClientInitParamView) ImmutableList(com.google.common.collect.ImmutableList) SurfaceNamer(com.google.api.codegen.transformer.SurfaceNamer)

Aggregations

SurfaceNamer (com.google.api.codegen.transformer.SurfaceNamer)1 ClientInitParamView (com.google.api.codegen.viewmodel.testing.ClientInitParamView)1 MockServiceUsageView (com.google.api.codegen.viewmodel.testing.MockServiceUsageView)1 ImmutableList (com.google.common.collect.ImmutableList)1