-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/misc/UnsupportedTypesTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.fasterxml.jackson.datatype.jsr310.misc; | ||
|
||
import java.time.temporal.TemporalAdjuster; | ||
import java.time.temporal.TemporalAdjusters; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.datatype.jsr310.ModuleTestBase; | ||
|
||
public class UnsupportedTypesTest extends ModuleTestBase | ||
{ | ||
// [modules-java8#207] | ||
static class TAWrapper { | ||
public TemporalAdjuster a; | ||
|
||
public TAWrapper(TemporalAdjuster a) { | ||
this.a = a; | ||
} | ||
} | ||
|
||
// [modules-java#207]: should not fail on `TemporalAdjuster` | ||
@Test | ||
public void testTemporalAdjusterSerialization() throws Exception | ||
{ | ||
ObjectMapper mapper = newMapper(); | ||
|
||
// Not 100% sure how this happens, actually; should fail on empty "POJO"? | ||
Assert.assertEquals(a2q("{'a':{}}"), | ||
mapper.writeValueAsString(new TAWrapper(TemporalAdjusters.firstDayOfMonth()))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters