1// Copyright 2019 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Code generated by gapic-generator. DO NOT EDIT.
16
17package trace
18
19import (
20	cloudtracepb "google.golang.org/genproto/googleapis/devtools/cloudtrace/v1"
21)
22
23import (
24	"context"
25	"fmt"
26	"strconv"
27	"testing"
28	"time"
29
30	"cloud.google.com/go/internal/testutil"
31	"google.golang.org/api/iterator"
32	"google.golang.org/api/option"
33)
34
35var _ = fmt.Sprintf
36var _ = iterator.Done
37var _ = strconv.FormatUint
38var _ = time.Now
39
40func TestTraceServiceSmoke(t *testing.T) {
41	if testing.Short() {
42		t.Skip("skipping smoke test in short mode")
43	}
44	ctx := context.Background()
45	ts := testutil.TokenSource(ctx, DefaultAuthScopes()...)
46	if ts == nil {
47		t.Skip("Integration tests skipped. See CONTRIBUTING.md for details")
48	}
49
50	projectId := testutil.ProjID()
51	_ = projectId
52
53	c, err := NewClient(ctx, option.WithTokenSource(ts))
54	if err != nil {
55		t.Fatal(err)
56	}
57
58	var projectId2 string = projectId
59	var request = &cloudtracepb.ListTracesRequest{
60		ProjectId: projectId2,
61	}
62
63	iter := c.ListTraces(ctx, request)
64	if _, err := iter.Next(); err != nil && err != iterator.Done {
65		t.Error(err)
66	}
67}
68