You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: opentsdb_test.rs
    path of file: ./repos/greptimedb/src/servers/tests/http
    
    the code of the file until where you have to start completion: // Copyright 2023 Greptime Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

use std::sync::Arc;

use api::v1::greptime_request::Request;
use async_trait::async_trait;
use axum::Router;
use axum_test_helper::TestClient;
use common_query::Output;
use common_test_util::ports;
use query::parser::PromQuery;
use query::plan::LogicalPlan;
use query::query_engine::DescribeResult;
use servers::error::{self, Result};
use servers::http::{HttpOptions, HttpServerBuilder};
use servers::opentsdb::codec::DataPoint;
use servers::query_handler::grpc::GrpcQueryHandler;
use servers::query_handler::sql::SqlQueryHandler;
use servers::query_handler::OpentsdbProtocolHandler;
use session::context::QueryContextRef;
use 
    
async fn test_opentsdb_put() {
    let (tx, mut rx) = mpsc::channel(100);

    let app = make_test_app(tx);
    let client = TestClient::new(app);

    // single data point put
    let result = client
        .post("/v1/opentsdb/api/put")
        .body(create_data_point("m1"))
        .send()
        .await;
    assert_eq!(result.status(), 204);
    assert!(result.text().await.is_empty());

    // multiple data point put
    let result = client
        .post("/v1/opentsdb/api/put")
        .body(format!(
            "[{},{}]",
            create_data_point("m2"),
            create_data_point("m3")
        ))
        .send()
        .await;
    assert_eq!(result.status(), 204);
    assert!(result.text().await.is_empty());

    // bad data point
    let result = client
        .post("/v1/opentsdb/api/put")
        .body("hello, world")
        .send()
        .await;
    assert_eq!(result.status(), 400);
    assert_eq!(
        result.text().await,
        "{\"error\":\"Invalid OpenTSDB Json request: expected value at line 1 column 1\"}"
    );

    // internal server error
    let result = client
        .post("/v1/opentsdb/api/put")
        .body(create_data_point("should_failed"))
        .send()
        .await;
    assert_eq!(result.status(), 500);
    assert_eq!(result.text().await, "{\"error\":\"Internal error: 1003\"}");

    let mut metrics = vec![];
    while let Ok(s) = rx.try_recv() {
        metrics.push(s);
    }
    assert_eq!(metrics, vec!["m1".to_string(), "m2".to_string()]);
}