2 * Samsung Ukraine R&D Center (SRK under a contract between)
3 * LLC "Samsung Electronics Co", Ltd (Seoul, Republic of Korea)
4 * Copyright (C) 2018 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License
18 #include <gtest/gtest.h>
19 #include "rest_request.h"
20 #include "restservice.h"
27 using namespace communication;
32 * Test checks device discovery use case
33 * 1. Search for unowned devices
34 * 2. Try API for device lists
35 * 3. Search for owned devices
36 * 4. Iterate thoughout the list and print devices info
38 TEST(Test_REST, DISABLED_test_get)
41 RestRequest request("http://106.125.46.139:11000/swagger-ui.html#/rest-device");
43 RestRequest::QueryParameters params = {{"user", "anon"}, {"id", "3"}};
44 request.addHeader("TestRestHeader", "some text");
45 RestRequest::Result result = request.get(params, "/", response);
46 ASSERT_EQ(RestRequest::HTTP_OK, result);
47 EXPECT_FALSE(response.empty());
48 EXPECT_EQ(response, request.body());
49 } catch (std::exception& e) {
50 FAIL() << "Exception: " << e.what();