Compare commits
2 Commits
5bf7063c05
...
45dc105dd0
Author | SHA1 | Date | |
---|---|---|---|
45dc105dd0 | |||
c779430e6f |
10
pom.xml
10
pom.xml
@@ -16,18 +16,18 @@
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
|
||||
<!-- Versions of compile dependencies -->
|
||||
<guava.version>33.4.0-jre</guava.version>
|
||||
<joda-time.version>2.13.0</joda-time.version>
|
||||
<guava.version>33.4.2-jre</guava.version>
|
||||
<joda-time.version>2.14.0</joda-time.version>
|
||||
|
||||
<!-- Versions of test dependencies -->
|
||||
<commons-lang3.version>3.17.0</commons-lang3.version>
|
||||
<logback.version>1.2.13</logback.version>
|
||||
<junit.version>5.11.4</junit.version>
|
||||
<junit.version>5.12.1</junit.version>
|
||||
<lombok.version>1.18.36</lombok.version>
|
||||
<hutool.version>5.8.35</hutool.version>
|
||||
<hutool.version>5.8.37</hutool.version>
|
||||
<mybatis.version>3.5.19</mybatis.version>
|
||||
<h2.version>2.2.224</h2.version>
|
||||
<jackson.version>2.18.2</jackson.version>
|
||||
<jackson.version>2.18.3</jackson.version>
|
||||
<gson.version>2.12.1</gson.version>
|
||||
</properties>
|
||||
|
||||
|
@@ -184,8 +184,6 @@ public class PagingAndSortingQueryParamsTests {
|
||||
assertThrows(IllegalArgumentException.class, queryParams::buildPagingParams);
|
||||
}
|
||||
|
||||
static final DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
|
||||
@Test
|
||||
void testGson() {
|
||||
Gson gson = new GsonBuilder()
|
||||
@@ -193,15 +191,27 @@ public class PagingAndSortingQueryParamsTests {
|
||||
|
||||
@Override
|
||||
public void write(JsonWriter out, LocalDate value) throws IOException {
|
||||
out.value(dateFormatter.format(value));
|
||||
out.value(DateTimeFormatter.ISO_DATE.format(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalDate read(JsonReader in) throws IOException {
|
||||
return LocalDate.parse(in.nextString(), dateFormatter);
|
||||
return LocalDate.parse(in.nextString(), DateTimeFormatter.ISO_DATE);
|
||||
}
|
||||
|
||||
})
|
||||
.registerTypeAdapter(LocalDateTime.class, new TypeAdapter<LocalDateTime>() {
|
||||
|
||||
@Override
|
||||
public void write(JsonWriter out, LocalDateTime value) throws IOException {
|
||||
out.value(DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocalDateTime read(JsonReader in) throws IOException {
|
||||
return LocalDateTime.parse(in.nextString(), DateTimeFormatter.ISO_LOCAL_DATE_TIME);
|
||||
}
|
||||
})
|
||||
.create();
|
||||
try (SqlSession session = sqlSessionFactory.openSession()) {
|
||||
AccountQueryParams params = gson.fromJson(JSON_STR, AccountQueryParams.class);
|
||||
@@ -212,6 +222,7 @@ public class PagingAndSortingQueryParamsTests {
|
||||
List<AccountVO> list = accountQueries.queryAccountList(params, pagingParams);
|
||||
long count = accountQueries.countAccount(params);
|
||||
PageResult<AccountVO> accountPageResult = PageResult.of(list, count);
|
||||
|
||||
log.info(gson.toJson(accountPageResult));
|
||||
|
||||
assertEquals(Lists.newArrayList(
|
||||
|
Reference in New Issue
Block a user