33import static org .assertj .core .api .Assertions .assertThat ;
44import static org .assertj .core .api .Assertions .assertThatThrownBy ;
55
6- import com .fasterxml .jackson .core . JsonProcessingException ;
6+ import com .fasterxml .jackson .databind . JsonMappingException ;
77import com .google .common .collect .ImmutableMap ;
88import com .hubspot .jinjava .Jinjava ;
99import com .hubspot .jinjava .JinjavaConfig ;
@@ -29,7 +29,7 @@ public void itSerializesMapWithNullKeysAsEmptyString() {
2929 }
3030
3131 @ Test
32- public void itSerializesMapEntrySet () throws JsonProcessingException {
32+ public void itSerializesMapEntrySet () {
3333 SizeLimitingPyMap map = new SizeLimitingPyMap (new HashMap <>(), 10 );
3434 map .put ("foo" , "bar" );
3535 map .put ("bar" , ImmutableMap .of ("foobar" , new ArrayList <>()));
@@ -39,7 +39,7 @@ public void itSerializesMapEntrySet() throws JsonProcessingException {
3939 }
4040
4141 @ Test
42- public void itSerializesMapEntrySetWithLimit () throws JsonProcessingException {
42+ public void itSerializesMapEntrySetWithLimit () {
4343 SizeLimitingPyMap map = new SizeLimitingPyMap (new HashMap <>(), 10 );
4444 map .put ("foo" , "bar" );
4545 map .put ("bar" , ImmutableMap .of ("foobar" , new ArrayList <>()));
@@ -85,7 +85,8 @@ public void itLimitsDepth() {
8585 JinjavaInterpreter .pushCurrent (jinjava .newInterpreter ());
8686 assertThatThrownBy (() -> PyishObjectMapper .getAsPyishStringOrThrow (original ))
8787 .as ("The string to be serialized is larger than the max output size" )
88- .isInstanceOf (LengthLimitingJsonProcessingException .class );
88+ .isInstanceOf (JsonMappingException .class )
89+ .hasMessageContaining ("Max length of 10000 chars reached" );
8990 } finally {
9091 JinjavaInterpreter .popCurrent ();
9192 }
0 commit comments