File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
mrbean/src/test/java/com/fasterxml/jackson/module/mrbean Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .fasterxml .jackson .module .mrbean ;
2
+
3
+ import com .fasterxml .jackson .databind .*;
4
+
5
+ import java .io .IOException ;
6
+
7
+ // test for [modules-base#52]
8
+ public class TestDefaultMethods
9
+ extends BaseTest {
10
+
11
+ public interface HasId {
12
+ long id ();
13
+ }
14
+
15
+ public interface HasIdImpl extends HasId {
16
+ @ Override
17
+ default long id () {
18
+ return 42L ;
19
+ }
20
+ }
21
+
22
+ public void testMaterializedDefaultMethod () throws IOException {
23
+ final ObjectMapper mapper = newMrBeanMapper ();
24
+
25
+ // Main thing is that we should not get an exception for missing method,
26
+ // as it is correctly deduced to have been implemented
27
+ final HasIdImpl bean = mapper .readValue ("{}" , HasIdImpl .class );
28
+ assertEquals (42L , bean .id ());
29
+ }
30
+ }
You can’t perform that action at this time.
0 commit comments