(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestEncodingEndpoints(t *testing.T) { |
| 11 | eps := []*registry.Endpoint{ |
| 12 | { |
| 13 | Name: "endpoint1", |
| 14 | Request: ®istry.Value{ |
| 15 | Name: "request", |
| 16 | Type: "request", |
| 17 | }, |
| 18 | Response: ®istry.Value{ |
| 19 | Name: "response", |
| 20 | Type: "response", |
| 21 | }, |
| 22 | Metadata: map[string]string{ |
| 23 | "foo1": "bar1", |
| 24 | }, |
| 25 | }, |
| 26 | { |
| 27 | Name: "endpoint2", |
| 28 | Request: ®istry.Value{ |
| 29 | Name: "request", |
| 30 | Type: "request", |
| 31 | }, |
| 32 | Response: ®istry.Value{ |
| 33 | Name: "response", |
| 34 | Type: "response", |
| 35 | }, |
| 36 | Metadata: map[string]string{ |
| 37 | "foo2": "bar2", |
| 38 | }, |
| 39 | }, |
| 40 | { |
| 41 | Name: "endpoint3", |
| 42 | Request: ®istry.Value{ |
| 43 | Name: "request", |
| 44 | Type: "request", |
| 45 | }, |
| 46 | Response: ®istry.Value{ |
| 47 | Name: "response", |
| 48 | Type: "response", |
| 49 | }, |
| 50 | Metadata: map[string]string{ |
| 51 | "foo3": "bar3", |
| 52 | }, |
| 53 | }, |
| 54 | } |
| 55 | |
| 56 | testEp := func(ep *registry.Endpoint, enc string) { |
| 57 | // encode endpoint |
| 58 | e := encodeEndpoints([]*registry.Endpoint{ep}) |
| 59 | |
| 60 | // check there are two tags; old and new |
| 61 | if len(e) != 1 { |
| 62 | t.Fatalf("Expected 1 encoded tags, got %v", e) |
| 63 | } |
| 64 | |
| 65 | // check old encoding |
| 66 | var seen bool |
| 67 |
nothing calls this directly
no test coverage detected
searching dependent graphs…