(_ context.Context, testName string)
| 114 | } |
| 115 | |
| 116 | func (h *harness) CreateTopic(_ context.Context, testName string) (dt driver.Topic, cleanup func(), err error) { |
| 117 | exchange := fmt.Sprintf("%s-topic-%d", testName, atomic.AddUint32(&h.numTopics, 1)) |
| 118 | if err := declareExchange(h.conn, exchange); err != nil { |
| 119 | return nil, nil, err |
| 120 | } |
| 121 | cleanup = func() { |
| 122 | ch, err := h.conn.Channel() |
| 123 | if err != nil { |
| 124 | panic(err) |
| 125 | } |
| 126 | ch.ExchangeDelete(exchange) |
| 127 | } |
| 128 | return newTopic(h.conn, exchange, nil), cleanup, nil |
| 129 | } |
| 130 | |
| 131 | func (h *harness) MakeNonexistentTopic(context.Context) (driver.Topic, error) { |
| 132 | return newTopic(h.conn, "nonexistent-topic", nil), nil |
no test coverage detected