parent
f6dbdcea45
commit
2aa3d7bb1d
2 changed files with 20 additions and 1 deletions
|
|
@ -56,7 +56,7 @@ object LanguageRange {
|
|||
def apply(language: Language, qValue: Float): LanguageRange = One(language, qValue)
|
||||
|
||||
JavaInitialization.initializeStaticFieldWith(
|
||||
`*`, classOf[jm.headers.HttpOriginRange].getField("ALL"))
|
||||
`*`, classOf[jm.headers.LanguageRange].getField("ALL"))
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* Copyright (C) 2009-2016 Lightbend Inc. <http://www.lightbend.com>
|
||||
*/
|
||||
|
||||
package akka.http.javadsl
|
||||
|
||||
import org.scalatest.{ Matchers, WordSpec }
|
||||
|
||||
class JavaInitializationSpec extends WordSpec with Matchers {
|
||||
|
||||
"LanguageRange" should {
|
||||
|
||||
"initializes the right field" in {
|
||||
akka.http.scaladsl.model.headers.LanguageRange.`*` // first we touch the scala one, it should force init the Java one
|
||||
akka.http.javadsl.model.headers.LanguageRange.ALL // touching this one should not fail
|
||||
akka.http.javadsl.model.headers.LanguageRanges.ALL // this is recommended and should work well too
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue