| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package main | 5 package main |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "bytes" | 8 "bytes" |
| 9 "encoding/binary" | 9 "encoding/binary" |
| 10 "fmt" | 10 "fmt" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 var _ pubSubService = (*testPubSubService)(nil) | 36 var _ pubSubService = (*testPubSubService)(nil) |
| 37 | 37 |
| 38 func TestMain(t *testing.T) { | 38 func TestMain(t *testing.T) { |
| 39 t.Parallel() | 39 t.Parallel() |
| 40 | 40 |
| 41 // Do not retry. | 41 // Do not retry. |
| 42 ctx := context.WithValue(context.Background(), backoffPolicyKey, func()
retry.Iterator { | 42 ctx := context.WithValue(context.Background(), backoffPolicyKey, func()
retry.Iterator { |
| 43 return &retry.Limited{} | 43 return &retry.Limited{} |
| 44 }) | 44 }) |
| 45 | 45 |
| 46 » Convey(`An application using testing stubs`, t, func() { | 46 » SkipConvey(`An application using testing stubs`, t, func() { |
| 47 config := config{ | 47 config := config{ |
| 48 pubsub: pubsubConfig{ | 48 pubsub: pubsubConfig{ |
| 49 project: "test-project", | 49 project: "test-project", |
| 50 topic: "test-topic", | 50 topic: "test-topic", |
| 51 subscription: "test-subscription", | 51 subscription: "test-subscription", |
| 52 create: false, | 52 create: false, |
| 53 batchSize: 64, | 53 batchSize: 64, |
| 54 }, | 54 }, |
| 55 endpoint: endpointConfig{ | 55 endpoint: endpointConfig{ |
| 56 url: "fake-protocol://test.endpoint", | 56 url: "fake-protocol://test.endpoint", |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 pubsubMock.MockCall("Pull", "test-subscription", 64).Wit
hResult(msgs, nil) | 143 pubsubMock.MockCall("Pull", "test-subscription", 64).Wit
hResult(msgs, nil) |
| 144 pubsubMock.MockCall("Ack", "test-subscription", []string
{"ack-big", "ack-legit"}).WithResult(nil) | 144 pubsubMock.MockCall("Ack", "test-subscription", []string
{"ack-big", "ack-legit"}).WithResult(nil) |
| 145 endpointMock.MockCall("send", mock.Ignore, msgs[1].Data)
.WithResult(nil) | 145 endpointMock.MockCall("send", mock.Ignore, msgs[1].Data)
.WithResult(nil) |
| 146 | 146 |
| 147 So(<-endpointMock.msgC, ShouldResemble, msgs[1].Data) | 147 So(<-endpointMock.msgC, ShouldResemble, msgs[1].Data) |
| 148 So(<-pubsubMock.ackC, ShouldResemble, []string{"ack-big"
, "ack-legit"}) | 148 So(<-pubsubMock.ackC, ShouldResemble, []string{"ack-big"
, "ack-legit"}) |
| 149 }) | 149 }) |
| 150 }) | 150 }) |
| 151 } | 151 } |
| OLD | NEW |