File tree Expand file tree Collapse file tree 4 files changed +41
-1
lines changed
main/resources/META-INF/services
tools/jackson/datatype/joda Expand file tree Collapse file tree 4 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ Project: jackson-datatype-joda
11
11
#146 : `DateTime` can' t be serialized with its own zone
12
12
(`WRITE_DATES_WITH_CONTEXT_TIME_ZONE` not respected)
13
13
(fixed by Joo-Hyuk K)
14
+ - Add unit test to verify goodness of SPI metadata for Modules
14
15
- Generate SBOMs [JSTEP-14]
15
16
16
17
2.19.1 (not yet released)
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 17
17
opens tools .jackson .datatype .joda .deser ;
18
18
opens tools .jackson .datatype .joda .ser ;
19
19
opens tools .jackson .datatype .joda .testutil .failure ;
20
+
21
+ provides tools .jackson .databind .JacksonModule with
22
+ tools .jackson .datatype .joda .JodaModule ;
23
+ uses tools .jackson .databind .JacksonModule ;
20
24
}
Original file line number Diff line number Diff line change
1
+ package tools .jackson .datatype .joda ;
2
+
3
+ import org .junit .jupiter .api .Test ;
4
+
5
+ import tools .jackson .databind .JacksonModule ;
6
+
7
+ import static org .junit .jupiter .api .Assertions .*;
8
+
9
+ import java .util .ServiceLoader ;
10
+
11
+ public class ModuleSPIMetadataTest
12
+ extends JodaTestBase
13
+ {
14
+ @ Test
15
+ void testModuleSPIMetadata () {
16
+ ServiceLoader <JacksonModule > loader
17
+ = ServiceLoader .load (JacksonModule .class );
18
+ assertTrue (loader .iterator ().hasNext (),
19
+ "Expected at least one `Module` implementation to be found via `ServiceLoader`" );
20
+ final String exp = JodaModule .class .getName ();
21
+ int count = 0 ;
22
+
23
+ try {
24
+ for (JacksonModule service : loader ) {
25
+ ++count ;
26
+ if (service .getClass ().getName ().equals (exp )) {
27
+ return ;
28
+ }
29
+ }
30
+ } catch (Throwable t ) {
31
+ fail ("Expected to find `" +exp +"` Module (found " +count +" so far), problem: " +t );
32
+ }
33
+ fail ("Expected to find `" +exp +"` Module (found " +count +" others)" );
34
+ assertEquals (1 , count );
35
+ }
36
+ }
You can’t perform that action at this time.
0 commit comments