Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Estrutura testes de integração para API. Objetivo esconder ferramentaria e simplificar os testes
package com.opportunity.simple.restapi.user
import com.opportunity.simple.restapi.basic.BasicBehaviour
class UserSpec extends BasicBehaviour {
"The user endpoint" should {
args(sequential=true)
"Create new user" ! userEndpointForTest().executeTestCreateNewUser()
"Try create a user with same email" ! userEndpointForTest().executeTestTryCreateAUserWithSameEmail()
}
case class userEndpointForTest() {
def executeTestCreateNewUser() = {
val response = sendToEndpointByPost(UserMessage.endpoint(), UserMessage.happyDay())
verifyResponseCodeOk( response )
}
def executeTestTryCreateAUserWithSameEmail() = {
pending
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment