 //MARK: requests to missing URLs
 
 let missingURL = baseURL.appendingPathComponent("404")
-func missingGET(_ request: URLRequest) -> ([TestURLServer.Chunk], HTTPURLResponse)
+func missingGET(_ request: URLRequest) -> ([TestURLServer.Command], HTTPURLResponse)
 {
   let response = HTTPURLResponse(url: missingURL, statusCode: 404, httpVersion: nil, headerFields: [:])
   XCTAssertNotNil(response)
-  return ([.data(Data("Not Found".utf8))], response!)
+  return ([.load(Data("Not Found".utf8)), .finishLoading], response!)
 }
 
 extension URLSessionTests


//MARK: requests with data in HTTP body

func handleStreamedBody(_ request: URLRequest) -> ([TestURLServer.Chunk], HTTPURLResponse)
{
  XCTAssertNil(request.httpBody)
  XCTAssertNotNil(request.httpBodyStream)

      headers["ETag"] = "\"" + String(dumbCheckSum, radix: 16) + "\""
      let cut = Int.random(in: (data.count/3...2*(data.count/3)))
      let response = HTTPURLResponse(url: largeURL, statusCode: 200, httpVersion: nil, headerFields: headers)!
      return ([.load(data[0..<cut]), .wait(10.0), .load(data[cut...]), .finishLoading], response)
    }
  }

