metatext/Mastodon/Sources/MastodonStubs/AccessTokenEndpoint+Stubbing.swift
Justin Mazzocchi 5f96f59ac3
wip
2020-08-31 03:21:01 -07:00

21 lines
556 B
Swift

// Copyright © 2020 Metabolist. All rights reserved.
import Foundation
import Mastodon
import Stubbing
extension AccessTokenEndpoint: Stubbing {
public func dataString(url: URL) -> String? {
switch self {
case let .oauthToken(_, _, _, _, scopes, _):
return """
{
"access_token": "ACCESS_TOKEN_STUB_VALUE",
"token_type": "Bearer",
"scope": "\(scopes)",
"created_at": "\(Int(Date().timeIntervalSince1970))"
}
"""
}
}
}