Summary: SonarWebSocketImpl has got pretty bloated. So I'm extracting all the file interaction out of it into ConnectionContextStore. The purpose of this class is to provide all the context needed to establish a connection. This makes SonarWebSocketImpl more functional and therefore testable. Reviewed By: priteshrnandgaonkar Differential Revision: D9540089 fbshipit-source-id: 0cd1d69f2b11eaf9f569245a2da14f85cc140427
29 lines
675 B
C++
29 lines
675 B
C++
#include <Sonar/ConnectionContextStore.h>
|
|
|
|
namespace facebook {
|
|
namespace sonar {
|
|
namespace test {
|
|
|
|
class ConnectionContextStoreMock : public ConnectionContextStore {
|
|
public:
|
|
ConnectionContextStoreMock() : ConnectionContextStore(DeviceData()) {
|
|
}
|
|
bool hasRequiredFiles() {
|
|
return true;
|
|
}
|
|
std::string createCertificateSigningRequest() {
|
|
return "thisIsACsr";
|
|
}
|
|
std::shared_ptr<SSLContext> getSSLContext() {
|
|
return nullptr;
|
|
}
|
|
dynamic getConnectionConfig() {
|
|
return nullptr;
|
|
}
|
|
std::string getCertificateDirectoryPath() {
|
|
return "/something/sonar/";
|
|
}
|
|
};
|
|
|
|
}}}
|