Skip to content

Commit

Permalink
Add test for #52
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Apr 5, 2019
1 parent d52fec9 commit eec459f
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.fasterxml.jackson.module.mrbean;

import com.fasterxml.jackson.databind.*;

import java.io.IOException;

// test for [modules-base#52]
public class TestDefaultMethods
extends BaseTest {

public interface HasId {
long id();
}

public interface HasIdImpl extends HasId {
@Override
default long id() {
return 42L;
}
}

public void testMaterializedDefaultMethod() throws IOException {
final ObjectMapper mapper = newMrBeanMapper();

// Main thing is that we should not get an exception for missing method,
// as it is correctly deduced to have been implemented
final HasIdImpl bean = mapper.readValue("{}", HasIdImpl.class);
assertEquals(42L, bean.id());
}
}

0 comments on commit eec459f

Please sign in to comment.