11package controllers
22
33import elastic .{ElasticResponse , Success }
4- import models .ElasticServer
4+ import models .{ ElasticServer , Host }
55import play .api .libs .json .Json
66import play .api .test .FakeRequest
77import play .api .test .Helpers ._
@@ -30,7 +30,7 @@ object AnalysisControllerSpec extends MockedServices {
3030 |]
3131 """ .stripMargin
3232 )
33- client.getIndices(ElasticServer (" somehost" )) returns Future .successful(Success (200 , expectedResponse))
33+ client.getIndices(ElasticServer (Host ( " somehost" ) )) returns Future .successful(Success (200 , expectedResponse))
3434 val response = route(application, FakeRequest (POST , " /analysis/indices" ).withBody(Json .obj(" host" -> " somehost" ))).get
3535 ensure(response, 200 , Json .arr(" index1" , " index2" ))
3636 }
@@ -58,7 +58,7 @@ object AnalysisControllerSpec extends MockedServices {
5858 |}
5959 """ .stripMargin
6060 )
61- client.getIndexSettings(" foo" , ElasticServer (" somehost" )) returns Future .successful(Success (200 , expectedResponse))
61+ client.getIndexSettings(" foo" , ElasticServer (Host ( " somehost" ) )) returns Future .successful(Success (200 , expectedResponse))
6262 val response = route(application, FakeRequest (POST , " /analysis/analyzers" ).withBody(Json .obj(" host" -> " somehost" , " index" -> " foo" ))).get
6363 ensure(response, 200 , Json .arr(" foo_analyzer" ))
6464 }
@@ -83,7 +83,7 @@ object AnalysisControllerSpec extends MockedServices {
8383 |}
8484 """ .stripMargin
8585 )
86- client.getIndexMapping(" foo" , ElasticServer (" somehost" )) returns Future .successful(Success (200 , expectedResponse))
86+ client.getIndexMapping(" foo" , ElasticServer (Host ( " somehost" ) )) returns Future .successful(Success (200 , expectedResponse))
8787 val response = route(application, FakeRequest (POST , " /analysis/fields" ).withBody(Json .obj(" host" -> " somehost" , " index" -> " foo" ))).get
8888 ensure(response, 200 , Json .arr(" name" ))
8989 }
@@ -104,7 +104,7 @@ object AnalysisControllerSpec extends MockedServices {
104104 |}
105105 """ .stripMargin
106106 )
107- client.analyzeTextByAnalyzer(" foo" , " bar" , " qux" , ElasticServer (" somehost" )) returns Future .successful(Success (200 , expectedResponse))
107+ client.analyzeTextByAnalyzer(" foo" , " bar" , " qux" , ElasticServer (Host ( " somehost" ) )) returns Future .successful(Success (200 , expectedResponse))
108108 val params = Json .obj(" host" -> " somehost" , " index" -> " foo" , " analyzer" -> " bar" , " text" -> " qux" )
109109 val response = route(application, FakeRequest (POST , " /analysis/analyze/analyzer" ).withBody(params)).get
110110 val expected = Json .parse(
@@ -138,7 +138,7 @@ object AnalysisControllerSpec extends MockedServices {
138138 |}
139139 """ .stripMargin
140140 )
141- client.analyzeTextByField(" foo" , " bar" , " qux" , ElasticServer (" somehost" )) returns Future .successful(Success (200 , expectedResponse))
141+ client.analyzeTextByField(" foo" , " bar" , " qux" , ElasticServer (Host ( " somehost" ) )) returns Future .successful(Success (200 , expectedResponse))
142142 val params = Json .obj(" host" -> " somehost" , " index" -> " foo" , " field" -> " bar" , " text" -> " qux" )
143143 val response = route(application, FakeRequest (POST , " /analysis/analyze/field" ).withBody(params)).get
144144 val expected = Json .parse(
0 commit comments