All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jp.co.cyberagent.aeromock.dsl.routing.RoutingDsl.groovy Maven / Gradle / Ivy

There is a newer version: 0.2.5
Show newest version
package jp.co.cyberagent.aeromock.dsl.routing

/**
 * Implementation of {@code routing} directive.
 * @author stormcat24
 */
class RoutingDsl {

    def call(Closure closure) {
        closure.setDelegate(this)
        closure.setResolveStrategy(Closure.DELEGATE_FIRST)
        closure.call()
        return _requestUri
    }

    def _requestUri

    def methodMissing(String methodName, args) {

        if (methodName == "server") {
            ServerDsl server = new ServerDsl(args)
            String result = server.execute()
            if (result != null) {
                _requestUri = result
            }
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy