Skip to content

Commit

Permalink
Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
seddonm1 committed Jul 16, 2019
1 parent c6c8070 commit cbe3127
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/ai/tripl/arc/extract/HTTPExtract.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class HTTPExtract extends PipelineStagePlugin {
import ai.tripl.arc.config.ConfigUtils._
implicit val c = config

val expectedKeys = "type" :: "name" :: "description" :: "environments" :: "inputView" :: "inputURI" :: "outputView" :: "body" :: "headers" :: "method" :: "numPartitions" :: "partitionBy" :: "persist" :: "validStatusCodes" :: "params" :: Nil
val expectedKeys = "type" :: "name" :: "description" :: "environments" :: "inputView" :: "inputURI" :: "outputView" :: "body" :: "headers" :: "method" :: "numPartitions" :: "partitionBy" :: "persist" :: "validStatusCodes" :: "uriField" :: "bodyField" :: "params" :: Nil
val name = getValue[String]("name")
val description = getOptionalValue[String]("description")
val inputView = if(c.hasPath("inputView")) getValue[String]("inputView") else Right("")
Expand Down
26 changes: 3 additions & 23 deletions src/test/scala/ai/tripl/arc/extract/HTTPExtractSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,6 @@ class HTTPExtractSuite extends FunSuite with BeforeAndAfter {
}
}

class PostPayloadEchoHandler extends AbstractHandler {
override def handle(target: String, request: HttpServletRequest, response: HttpServletResponse, dispatch: Int) = {
if (HttpConnection.getCurrentConnection.getRequest.getMethod == "POST" ) {
response.setContentType("text/html")
response.setStatus(HttpServletResponse.SC_OK)
response.getWriter().print(Source.fromInputStream(request.getInputStream).mkString)
} else {
response.setStatus(HttpServletResponse.SC_FORBIDDEN)
}
HttpConnection.getCurrentConnection.getRequest.setHandled(true)
}
}

class EmptyHandler extends AbstractHandler {
override def handle(target: String, request: HttpServletRequest, response: HttpServletResponse, dispatch: Int) = {
response.setContentType("text/html")
Expand Down Expand Up @@ -203,7 +190,6 @@ class HTTPExtractSuite extends FunSuite with BeforeAndAfter {
}
}


test("HTTPExtract: Can read data (GET)") {
implicit val spark = session
import spark.implicits._
Expand All @@ -226,9 +212,7 @@ class HTTPExtractSuite extends FunSuite with BeforeAndAfter {
numPartitions=None,
partitionBy=Nil,
method="GET",
body=None,
uriField=None,
bodyField=None
body=None
)
).get

Expand Down Expand Up @@ -269,9 +253,7 @@ class HTTPExtractSuite extends FunSuite with BeforeAndAfter {
numPartitions=None,
partitionBy=Nil,
method="POST",
body=None,
uriField=None,
bodyField=None
body=None
)
).get

Expand Down Expand Up @@ -466,9 +448,7 @@ class HTTPExtractSuite extends FunSuite with BeforeAndAfter {
numPartitions=None,
partitionBy=Nil,
method="GET",
body=None,
uriField=None,
bodyField=None
body=None
)
).get

Expand Down

0 comments on commit cbe3127

Please sign in to comment.