File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed
extension/java-client-operate
main/java/io/camunda/operate/auth
test/java/io/camunda/operate/auth Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 6262 <artifactId >mockito-junit-jupiter</artifactId >
6363 <scope >test</scope >
6464 </dependency >
65+ <dependency >
66+ <groupId >org.assertj</groupId >
67+ <artifactId >assertj-core</artifactId >
68+ <scope >test</scope >
69+ </dependency >
6570 </dependencies >
6671
6772 <build >
Original file line number Diff line number Diff line change 11package io .camunda .operate .auth ;
22
3+ import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
34import com .fasterxml .jackson .annotation .JsonProperty ;
45
6+ @ JsonIgnoreProperties (ignoreUnknown = true )
57public class TokenResponse {
68
79 @ JsonProperty ("access_token" )
Original file line number Diff line number Diff line change 1+ package io .camunda .operate .auth ;
2+
3+ import static org .assertj .core .api .Assertions .*;
4+
5+ import com .fasterxml .jackson .databind .ObjectMapper ;
6+ import io .camunda .operate .auth .TokenResponseMapper .JacksonTokenResponseMapper ;
7+ import org .junit .jupiter .api .Test ;
8+
9+ public class TokenResponseTest {
10+ @ Test
11+ void shouldIgnoreUnknownFields () {
12+ TokenResponseMapper tokenResponseMapper = new JacksonTokenResponseMapper (new ObjectMapper ());
13+ TokenResponse tokenResponse = tokenResponseMapper .readToken ("{\" weird_field\" :123}" );
14+ assertThat (tokenResponse ).isNotNull ();
15+ }
16+ }
You can’t perform that action at this time.
0 commit comments