Skip to content

Instantly share code, notes, and snippets.

@agnaldo4j
Last active October 31, 2015 12:21
Show Gist options
  • Save agnaldo4j/ff094cf35ca6333b4e18 to your computer and use it in GitHub Desktop.
Save agnaldo4j/ff094cf35ca6333b4e18 to your computer and use it in GitHub Desktop.
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