(t *testing.T)
| 112 | } |
| 113 | |
| 114 | func TestImportFromURL(t *testing.T) { |
| 115 | RegisterTestingT(t) |
| 116 | |
| 117 | // reading file and preparing json payload |
| 118 | pairFile, err := os.Open(hoverflyIoSimulationPath) |
| 119 | Expect(err).To(BeNil()) |
| 120 | pairFileBytes, err := io.ReadAll(pairFile) |
| 121 | Expect(err).To(BeNil()) |
| 122 | |
| 123 | // pretending this is the endpoint with given json |
| 124 | server, unit := testTools(200, string(pairFileBytes)) |
| 125 | defer server.Close() |
| 126 | |
| 127 | // importing payloads |
| 128 | err = unit.Import(server.URL) |
| 129 | Expect(err).To(BeNil()) |
| 130 | |
| 131 | Expect(unit.Simulation.GetMatchingPairs()).To(HaveLen(2)) |
| 132 | } |
| 133 | |
| 134 | func TestImportFromURLRedirect(t *testing.T) { |
| 135 | RegisterTestingT(t) |
nothing calls this directly
no test coverage detected