Skip to content

Commit 99f73a0

Browse files
committed
Fix tests for main
1 parent 6b996e3 commit 99f73a0

1 file changed

Lines changed: 8 additions & 20 deletions

File tree

spring-cloud-openfeign-core/src/test/java/org/springframework/cloud/openfeign/support/PageJacksonModuleTests.java

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,11 @@ void serializeAndDeserializeFilledMultipleCascade() {
190190
}
191191

192192
@Test
193-
void deserializePageableWithHyphenatedAlias() throws IOException {
193+
void deserializePageableWithHyphenatedAlias() {
194194
// Given
195-
ObjectMapper kebabObjectMapepr = objectMapper.copy();
196-
kebabObjectMapepr.setPropertyNamingStrategy(PropertyNamingStrategies.KEBAB_CASE);
197195
File file = new File("./src/test/resources/withPageableAliasHyphen.json");
198196
// When
199-
Page<?> result = kebabObjectMapepr.readValue(file, Page.class);
197+
Page<?> result = objectMapper.readValue(file, Page.class);
200198
// Then
201199
assertThat(result).isNotNull();
202200
assertThat(result.getTotalElements()).isEqualTo(15);
@@ -209,14 +207,11 @@ void deserializePageableWithHyphenatedAlias() throws IOException {
209207
}
210208

211209
@Test
212-
void deserializePageableWithUnderscoreAlias() throws IOException {
210+
void deserializePageableWithUnderscoreAlias() {
213211
// Given
214-
ObjectMapper snakeCaseObjectMapper = objectMapper.copy();
215-
snakeCaseObjectMapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
216212
File file = new File("./src/test/resources/withPageableAliasUnderscore.json");
217-
218213
// When
219-
Page<?> result = snakeCaseObjectMapper.readValue(file, Page.class);
214+
Page<?> result = objectMapper.readValue(file, Page.class);
220215
// Then
221216
assertThat(result).isNotNull();
222217
assertThat(result.getTotalElements()).isEqualTo(10);
@@ -229,15 +224,11 @@ void deserializePageableWithUnderscoreAlias() throws IOException {
229224
}
230225

231226
@Test
232-
void deserializePageableWithLowercaseAlias() throws IOException {
227+
void deserializePageableWithLowercaseAlias() {
233228
// Given
234-
ObjectMapper lowerCaseObjectMapper = objectMapper.copy();
235-
lowerCaseObjectMapper.setPropertyNamingStrategy(PropertyNamingStrategies.LOWER_CASE);
236-
237229
File file = new File("./src/test/resources/withPageableAliasLowercase.json");
238-
239230
// When
240-
Page<?> result = lowerCaseObjectMapper.readValue(file, Page.class);
231+
Page<?> result = objectMapper.readValue(file, Page.class);
241232
// Then
242233
assertThat(result).isNotNull();
243234
assertThat(result.getTotalElements()).isEqualTo(8);
@@ -249,14 +240,11 @@ void deserializePageableWithLowercaseAlias() throws IOException {
249240
}
250241

251242
@Test
252-
void deserializePageableWithPascalCaseAlias() throws IOException {
243+
void deserializePageableWithPascalCaseAlias() {
253244
// Given
254-
ObjectMapper upperCamelCaseObjectMapper = objectMapper.copy();
255-
upperCamelCaseObjectMapper.setPropertyNamingStrategy(PropertyNamingStrategies.UPPER_CAMEL_CASE);
256245
File file = new File("./src/test/resources/withPageableAliasPascalCase.json");
257-
258246
// When
259-
Page<?> result = upperCamelCaseObjectMapper.readValue(file, Page.class);
247+
Page<?> result = objectMapper.readValue(file, Page.class);
260248
// Then
261249
assertThat(result).isNotNull();
262250
assertThat(result.getTotalElements()).isEqualTo(20);

0 commit comments

Comments
 (0)