Skip to content

Commit

Permalink
Remove HTTP influxDbServiceUrl() and HTTP::databaseName() methods (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
offa committed Jan 28, 2023
1 parent 4f1f45e commit 57b6c42
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 34 deletions.
10 changes: 0 additions & 10 deletions src/HTTP.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,6 @@ namespace influxdb::transports
checkResponse(response);
}

std::string HTTP::databaseName() const
{
return mDatabaseName;
}

std::string HTTP::influxDbServiceUrl() const
{
return mInfluxDbServiceUrl;
}

void HTTP::setProxy(const Proxy& proxy)
{
session.SetProxies(cpr::Proxies{{"http", proxy.getProxy()}, {"https", proxy.getProxy()}});
Expand Down
6 changes: 0 additions & 6 deletions src/HTTP.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ namespace influxdb::transports
/// \param auth <username>:<password>
void enableBasicAuth(const std::string& auth);

/// Get the database name managed by this transport
[[nodiscard]] std::string databaseName() const;

/// Get the influx service url which transport connects to
[[nodiscard]] std::string influxDbServiceUrl() const;

/// Sets proxy
void setProxy(const Proxy& proxy) override;

Expand Down
18 changes: 0 additions & 18 deletions test/HttpTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -225,24 +225,6 @@ namespace influxdb::test
http.enableBasicAuth("user0:pass0");
}

TEST_CASE("Database name is returned if valid", "[HttpTest]")
{
ALLOW_CALL(sessionMock, SetTimeout(_));
ALLOW_CALL(sessionMock, SetConnectTimeout(_));

const HTTP http{"http://localhost:8086?db=example-database-0"};
CHECK(http.databaseName() == "example-database-0");
}

TEST_CASE("Database service url is returned if valid", "[HttpTest]")
{
ALLOW_CALL(sessionMock, SetTimeout(_));
ALLOW_CALL(sessionMock, SetConnectTimeout(_));

const HTTP http{"http://localhost:8086?db=example-database-1"};
CHECK(http.influxDbServiceUrl() == "http://localhost:8086");
}

TEST_CASE("Set proxy without authentication", "[HttpTest]")
{
auto http = createHttp();
Expand Down

0 comments on commit 57b6c42

Please sign in to comment.