-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b369273
commit 49811b1
Showing
3 changed files
with
77 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// | ||
// MockFSGetAppStatus.swift | ||
// | ||
// | ||
// Created by Mykola Buhaiov on 23.11.2023. | ||
// Copyright © 2023 Freedom Space LLC | ||
// All rights reserved: http://opensource.org/licenses/MIT | ||
// | ||
|
||
import Vapor | ||
@testable import FSGetAppStatus | ||
|
||
struct MockFSGetAppStatus: FSGetAppStatusServiceable { | ||
var eventLoop: EventLoop | ||
|
||
func getRedisStatus() -> EventLoopFuture<String> { | ||
return eventLoop.future("Ok") | ||
} | ||
|
||
func getPostgresStatus() -> EventLoopFuture<(String, String, HTTPResponseStatus)> { | ||
return eventLoop.future(("Ok", "Ok", HTTPResponseStatus.ok)) | ||
} | ||
|
||
func getMongoDBStatus(host: String, port: String) -> EventLoopFuture<(String, HTTPResponseStatus)> { | ||
return eventLoop.future(("Ok", HTTPResponseStatus.ok)) | ||
} | ||
|
||
func getRedisStatusAsync() async -> String { | ||
"Ok" | ||
} | ||
|
||
func getPostgresStatusAsync() async -> (String, String, HTTPResponseStatus) { | ||
return ("Ok", "Ok", HTTPResponseStatus.ok) | ||
} | ||
|
||
func getMongoDBStatusAsync(host: String, port: String) async -> (String, HTTPResponseStatus) { | ||
return ("Ok", HTTPResponseStatus.ok) | ||
} | ||
|
||
func applicationLaunchTime() { } | ||
|
||
func applicationUpTime() -> Double { | ||
Double() | ||
} | ||
|
||
func applicationLaunchDate() { } | ||
|
||
func applicationUpDate() -> String { | ||
"" | ||
} | ||
} |