File tree 3 files changed +32
-2
lines changed
src/test/java/com/uploadcare/api
3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 20
20
dependencies {
21
21
implementation(" org.apache.httpcomponents:httpclient:4.5.13" )
22
22
implementation(" org.apache.httpcomponents:httpmime:4.5.13" )
23
- implementation(" com.fasterxml.jackson.core:jackson-databind:2.12.6.1 " )
23
+ implementation(" com.fasterxml.jackson.core:jackson-databind:2.16.2 " )
24
24
implementation(" commons-codec:commons-codec:1.10" )
25
25
implementation(" commons-io:commons-io:2.7" )
26
26
implementation(" com.sun.activation:javax.activation:1.2.0" )
Original file line number Diff line number Diff line change 1
1
# Project-wide Gradle settings.
2
- version =3.5.2
2
+ version =3.5.3-SNAPSHOT
3
3
4
4
# Signature key id
5
5
signing.gnupg.keyName =A0835D6B27223852
Original file line number Diff line number Diff line change
1
+ package com .uploadcare .api ;
2
+
3
+ import com .fasterxml .jackson .databind .DeserializationFeature ;
4
+ import com .fasterxml .jackson .databind .ObjectMapper ;
5
+ import com .fasterxml .jackson .databind .PropertyNamingStrategies ;
6
+ import org .junit .Assert ;
7
+ import org .junit .Test ;
8
+
9
+ public class FileTest
10
+ {
11
+
12
+ @ Test
13
+ public void enumFails () throws Exception {
14
+ String json = "{ \" color_mode\" : \" RGBa\" }" ;
15
+
16
+ // duplicate the way the mapper is configured in uploadcare
17
+ ObjectMapper mapper = new ObjectMapper ();
18
+ mapper .setPropertyNamingStrategy (PropertyNamingStrategies .SNAKE_CASE );
19
+ mapper .disable (DeserializationFeature .FAIL_ON_UNKNOWN_PROPERTIES );
20
+
21
+ Bug bug = mapper .readValue (json , Bug .class );
22
+
23
+ Assert .assertTrue ("Color mode was not properly converted!" , File .ColorMode .RGBa .equals (bug .colorMode ));
24
+ }
25
+
26
+ static class Bug {
27
+ public File .ColorMode colorMode ;
28
+ }
29
+
30
+ }
You can’t perform that action at this time.
0 commit comments