Skip to content

Commit 847b956

Browse files
committed
Update to the latest oatpp API.
1 parent 1a974fb commit 847b956

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

test/oatpp-mbedtls/FullAsyncTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,23 +160,23 @@ void FullAsyncTest::onRun() {
160160
{ // test GET with path parameter
161161
auto response = client->getWithParams("my_test_param-Async", connection);
162162
OATPP_ASSERT(response->getStatusCode() == 200);
163-
auto dto = response->readBodyToDto<app::TestDto>(objectMapper.get());
163+
auto dto = response->readBodyToDto<oatpp::Object<app::TestDto>>(objectMapper.get());
164164
OATPP_ASSERT(dto);
165165
OATPP_ASSERT(dto->testValue == "my_test_param-Async");
166166
}
167167

168168
{ // test GET with header parameter
169169
auto response = client->getWithHeaders("my_test_header-Async", connection);
170170
OATPP_ASSERT(response->getStatusCode() == 200);
171-
auto dto = response->readBodyToDto<app::TestDto>(objectMapper.get());
171+
auto dto = response->readBodyToDto<oatpp::Object<app::TestDto>>(objectMapper.get());
172172
OATPP_ASSERT(dto);
173173
OATPP_ASSERT(dto->testValue == "my_test_header-Async");
174174
}
175175

176176
{ // test POST with body
177177
auto response = client->postBody("my_test_body-Async", connection);
178178
OATPP_ASSERT(response->getStatusCode() == 200);
179-
auto dto = response->readBodyToDto<app::TestDto>(objectMapper.get());
179+
auto dto = response->readBodyToDto<oatpp::Object<app::TestDto>>(objectMapper.get());
180180
OATPP_ASSERT(dto);
181181
OATPP_ASSERT(dto->testValue == "my_test_body-Async");
182182
}

test/oatpp-mbedtls/FullTest.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,23 +153,23 @@ void FullTest::onRun() {
153153
{ // test GET with path parameter
154154
auto response = client->getWithParams("my_test_param", connection);
155155
OATPP_ASSERT(response->getStatusCode() == 200);
156-
auto dto = response->readBodyToDto<app::TestDto>(objectMapper.get());
156+
auto dto = response->readBodyToDto<oatpp::Object<app::TestDto>>(objectMapper.get());
157157
OATPP_ASSERT(dto);
158158
OATPP_ASSERT(dto->testValue == "my_test_param");
159159
}
160160

161161
{ // test GET with query parameters
162162
auto response = client->getWithQueries("oatpp", 1, connection);
163163
OATPP_ASSERT(response->getStatusCode() == 200);
164-
auto dto = response->readBodyToDto<app::TestDto>(objectMapper.get());
164+
auto dto = response->readBodyToDto<oatpp::Object<app::TestDto>>(objectMapper.get());
165165
OATPP_ASSERT(dto);
166166
OATPP_ASSERT(dto->testValue == "name=oatpp&age=1");
167167
}
168168

169169
{ // test GET with query parameters
170170
auto response = client->getWithQueriesMap("value1", 32, 0.32, connection);
171171
OATPP_ASSERT(response->getStatusCode() == 200);
172-
auto dto = response->readBodyToDto<app::TestDto>(objectMapper.get());
172+
auto dto = response->readBodyToDto<oatpp::Object<app::TestDto>>(objectMapper.get());
173173
OATPP_ASSERT(dto);
174174
OATPP_ASSERT(dto->testMap);
175175
OATPP_ASSERT(dto->testMap->size() == 3);
@@ -181,15 +181,15 @@ void FullTest::onRun() {
181181
{ // test GET with header parameter
182182
auto response = client->getWithHeaders("my_test_header", connection);
183183
OATPP_ASSERT(response->getStatusCode() == 200);
184-
auto dto = response->readBodyToDto<app::TestDto>(objectMapper.get());
184+
auto dto = response->readBodyToDto<oatpp::Object<app::TestDto>>(objectMapper.get());
185185
OATPP_ASSERT(dto);
186186
OATPP_ASSERT(dto->testValue == "my_test_header");
187187
}
188188

189189
{ // test POST with body
190190
auto response = client->postBody("my_test_body", connection);
191191
OATPP_ASSERT(response->getStatusCode() == 200);
192-
auto dto = response->readBodyToDto<app::TestDto>(objectMapper.get());
192+
auto dto = response->readBodyToDto<oatpp::Object<app::TestDto>>(objectMapper.get());
193193
OATPP_ASSERT(dto);
194194
OATPP_ASSERT(dto->testValue == "my_test_body");
195195
}

test/oatpp-mbedtls/app/DTOs.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ namespace oatpp { namespace test { namespace mbedtls { namespace app {
3232

3333
#include OATPP_CODEGEN_BEGIN(DTO)
3434

35-
class TestDto : public oatpp::Object {
35+
class TestDto : public oatpp::DTO {
3636

37-
DTO_INIT(TestDto, Object)
37+
DTO_INIT(TestDto, DTO)
3838

3939
DTO_FIELD(String, testValue);
4040
DTO_FIELD(Fields<String>, testMap);

0 commit comments

Comments
 (0)