URLProtocol 기반 네트워크 목킹
네트워크 계층을 테스트하려고 URLProtocol 서브클래스로 응답을 가로채기로 했습니다. 옳은 설명을 모두 고르세요.
final class StubProtocol: URLProtocol {
static var handler: ((URLRequest) throws -> (HTTPURLResponse, Data))?
override class func canInit(with request: URLRequest) -> Bool { true }
override class func canonicalRequest(for request: URLRequest) -> URLRequest { request }
override func startLoading() { /* ... */ }
override func stopLoading() {}
}복수 선택 가능