(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func TestInputFileWithGET(t *testing.T) { |
| 16 | input := NewTestInput() |
| 17 | rg := NewRequestGenerator([]PluginReader{input}, func() { input.EmitGET() }, 1) |
| 18 | readPayloads := []*Message{} |
| 19 | |
| 20 | // Given a capture file with a GET request |
| 21 | expectedCaptureFile := CreateCaptureFile(rg) |
| 22 | defer expectedCaptureFile.TearDown() |
| 23 | |
| 24 | // When the request is read from the capture file |
| 25 | err := ReadFromCaptureFile(expectedCaptureFile.file, 1, func(msg *Message) { |
| 26 | readPayloads = append(readPayloads, msg) |
| 27 | }) |
| 28 | |
| 29 | // The read request should match the original request |
| 30 | if err != nil { |
| 31 | t.Error(err) |
| 32 | } else if !expectedCaptureFile.PayloadsEqual(readPayloads) { |
| 33 | t.Error("Request read back from file should match") |
| 34 | |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | func TestInputFileWithPayloadLargerThan64Kb(t *testing.T) { |
| 39 | input := NewTestInput() |
nothing calls this directly
no test coverage detected