Skip to content

Commit 0e4211a

Browse files
committed
Create ServiceLoaderSpec.scala
1 parent 25547dc commit 0e4211a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.fasterxml.jackson.module.scala
2+
3+
import java.util.ServiceLoader
4+
5+
import scala.collection.JavaConverters._
6+
7+
class ServiceLoaderSpec extends BaseSpec {
8+
"A ServiceLoader" should "be able to load DefaultScalaModule" in {
9+
val loader = ServiceLoader.load(classOf[com.fasterxml.jackson.databind.Module])
10+
val modules = loader.iterator().asScala.toList
11+
modules should not be empty
12+
modules.collectFirst {
13+
case m if m.getClass.getName == "com.fasterxml.jackson.module.scala.DefaultScalaModule" => m
14+
} should not be empty
15+
}
16+
}

0 commit comments

Comments
 (0)