Skip to content

Commit

Permalink
Fix code format
Browse files Browse the repository at this point in the history
  • Loading branch information
velo committed Jan 25, 2024
1 parent 7397d0f commit a72b9f5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
26 changes: 12 additions & 14 deletions jackson-jr/src/test/java/feign/jackson/jr/JacksonCodecTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.util.Map;
import java.util.Objects;
import java.util.stream.Stream;

import org.junit.jupiter.api.Test;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.jr.ob.JSON;
Expand Down Expand Up @@ -297,15 +296,16 @@ void notFoundDecodesToEmpty() throws Exception {

@ParameterizedTest
@MethodSource("decodeGenericsArguments")
void decodeGenerics(Response response, Type responseType, DataWrapper<?> expectedDataWrapper) throws IOException {
assertThat(new JacksonJrDecoder().decode(response, responseType)).isEqualTo(expectedDataWrapper);
void decodeGenerics(Response response, Type responseType, DataWrapper<?> expectedDataWrapper)
throws IOException {
assertThat(new JacksonJrDecoder().decode(response, responseType))
.isEqualTo(expectedDataWrapper);
}

static class DataWrapper<T> {
private T data;

DataWrapper() {
}
DataWrapper() {}

DataWrapper(T data) {
this.data = data;
Expand All @@ -317,8 +317,10 @@ public void setData(T data) {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
DataWrapper<?> that = (DataWrapper<?>) o;
return Objects.equals(data, that.data);
}
Expand All @@ -332,19 +334,15 @@ static Stream<Arguments> decodeGenericsArguments() {
"/v1/dummy",
Collections.emptyMap(),
Request.Body.empty(),
null
));
null));
return Stream.of(
Arguments.of(
responseBuilder.body("{\"data\":2024}", StandardCharsets.UTF_8).build(),
new TypeReference<DataWrapper<Integer>>() {}.getType(),
new DataWrapper<>(2024)
),
new DataWrapper<>(2024)),
Arguments.of(
responseBuilder.body("{\"data\":\"Hello, World!\"}", StandardCharsets.UTF_8).build(),
new TypeReference<DataWrapper<String>>() {}.getType(),
new DataWrapper<>("Hello, World!")
)
);
new DataWrapper<>("Hello, World!")));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.simple.SimpleConfig;
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -81,7 +80,7 @@ public InvocationHandlerFactory enrich(InvocationHandlerFactory invocationHandle

private List<Tag> mapTags(Map<String, String> tags) {
return tags.keySet().stream()
.map(tagKey -> Tag.of(tagKey, tags.get(tagKey)))
.collect(Collectors.toList());
.map(tagKey -> Tag.of(tagKey, tags.get(tagKey)))
.collect(Collectors.toList());
}
}

0 comments on commit a72b9f5

Please sign in to comment.