         ("testAccessingProtectedRouteWithOneInvalidScopeOneValidReturns401", testAccessingProtectedRouteWithOneInvalidScopeOneValidReturns401),
         ("testAccessingProtectedRouteWithLowercaseHeaderWorks", testAccessingProtectedRouteWithLowercaseHeaderWorks),
         ("testThatAccessingProtectedRouteWithExpiredTokenReturns401", testThatAccessingProtectedRouteWithExpiredTokenReturns401),
+        ("testTokenIntrospectionEndpoint", testTokenIntrospectionEndpoint),
         ]
     
     // MARK: - Properties

        XCTAssertEqual(protectedResponse.status, .unauthorized)
    }
    
}

struct TestResourceController {

        return json
    }
}

struct RemoteResourceController {
    let drop: Droplet
    
    func addRoutes() {
        
        let oauthMiddleware = OAuth2Middleware(tokenIntrospectionEndpoint: "http://localhost:8082")
        let protected = drop.grouped(oauthMiddleware)
        
        protected.get("protected", handler: protectedHandler)
        protected.get("user", handler: getOAuthUser)
    }
    
    func protectedHandler(request: Request) throws -> ResponseRepresentable {
        return "PROTECTED"
    }
    
    func getOAuthUser(request: Request) throws -> ResponseRepresentable {
        let user: OAuthUser = try request.oauth.user()
        var json = JSON()
        try json.set("userID", user.id)
        try json.set("email", user.emailAddress)
        try json.set("username", user.username)
        
        return json
    }
}

struct OAuth2Middleware: Middleware {
    let tokenIntrospectionEndpoint: String
    
    func respond(to request: Request, chainingTo next: Responder) throws -> Response {
        return try next.respond(to: request)
    }
}
