Ratpack tests are based on Spock Framework.
To externalize properties from test cases, create new file in:
$ touch src/tests/resources/hipchat.properties
Put properties into the file:
auth_token=VALUE_OF_HIPCHAT_AUTH_TOKEN
In test case add reference to properties and common setup() method. Inside side load properties file from classs path
// src/test/groovy/HipChatApiTest.groovy
import spock.lang.Specification
class HipChatApiTest extends Specification {
Properties properties
def setup() {
properties = new Properties()
properties.load(getClass().getClassLoader().getResourceAsStream("hipchat.properties"))
}
def "Send new hipchat notification"() {
given:
String hipchatUrl = "https://api.hipchat.com/v2/room/online4m.com/notification?auth_token=${properties.auth_token}"
}
}