Skip to content

Commit

Permalink
Fix unit tests (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
juanitodread authored Sep 19, 2019
1 parent d22957e commit 62b8729
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ The current version of this API is **v1**.
All data is sent and received as **JSON**.

### Root endpoint
The root endpoint is: `http://<host>:<port>/pitaya-finch/api/v1/`
The root endpoint is: `http://<host>:<port>/pitaya/api/v1/`


## NLP
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# server
server {
context = "pitaya"
port: 8080
port: ${?PORT}
port = 8080
port = ${?PORT}
}

api {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.twitter.util.Promise
import org.juanitodread.pitayafinch.UnitSpec

class EndpointsTest extends UnitSpec {
private val baseApi = "/pitaya-finch/api/v1"
private val baseApi = "/pitaya/api/v1"
private val endpoints = List(
s"$baseApi",
s"$baseApi/help",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import io.finch._
import org.juanitodread.pitayafinch.UnitSpec

class IndexTest extends UnitSpec {
private val baseApi = "/pitaya-finch/api/v1"
private val baseApi = "/pitaya/api/v1"

"An Index route" should "have an index endpoint" in {
assert(Index.index.apply(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.juanitodread.pitayafinch.UnitSpec
import org.juanitodread.pitayafinch.model.CommonMessage

class UserTest extends UnitSpec {
private val baseApi = "/pitaya-finch/api/v1/users"
private val baseApi = "/pitaya/api/v1/users"

"A User route" should "have an index endpoint" in {
assert(User.index.apply(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.juanitodread.pitayafinch.UnitSpec
import org.juanitodread.pitayafinch.model.{ User => UserModel }

class UsersTest extends UnitSpec {
private val baseApi = "/pitaya-finch/api/v1/crud/users"
private val baseApi = "/pitaya/api/v1/crud/users"

def prepareUsers(): List[UserModel] = {
val usersFixture = List(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.juanitodread.pitayafinch.UnitSpec
import org.juanitodread.pitayafinch.model.nlp.tokenizer._

class NormalizerEndpointSpec extends UnitSpec {
private val baseApi = "/pitaya-finch/api/v1/nlp/normalizer"
private val baseApi = "/pitaya/api/v1/nlp/normalizer"

"A NormalizerEndpoint route" should "have lowercase endpoint" in {
val request = LowerCaseRequest(List("This", "SHOULD", "bE", "lOwErcASE"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.juanitodread.pitayafinch.UnitSpec
import org.juanitodread.pitayafinch.model.nlp.tokenizer._

class PipelineEndpointSpec extends UnitSpec {
private val baseApi = "/pitaya-finch/api/v1/nlp/pipeline"
private val baseApi = "/pitaya/api/v1/nlp/pipeline"

"A PipelineEndpoint route" should "have pipeline endpoint" in {
val request = PipelineRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import org.juanitodread.pitayafinch.model.nlp.tokenizer.{
}

class TokenizerEndpointSpec extends UnitSpec {
private val baseApi = "/pitaya-finch/api/v1/nlp/tokenizer"
private val baseApi = "/pitaya/api/v1/nlp/tokenizer"

"A TokenizerEndpoint route" should "have getAlgorithms endpoint" in {
TokenizerEndpoint.getAlgorithms().apply(Input.get(baseApi)).awaitValueUnsafe().get should equal {
Expand Down

0 comments on commit 62b8729

Please sign in to comment.