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

org.nuisto.ExpectationBuilder.groovy Maven / Gradle / Ivy

There is a newer version: 0.6.0-alpha-1
Show newest version
package org.nuisto

import groovy.util.logging.Slf4j

@Slf4j(category = 'org.nuisto.msa')
class ExpectationBuilder {
  Expectation currentExpectation
  List expectations = new ArrayList()

  ExpectationBuilder() {
  }

  void element(String name) {
    Expectation expectation = new Expectation(elementName: name)

    currentExpectation = expectation

    expectations << expectation
  }

  void hasAttribute(String attribute) {
    currentExpectation.hasAttribute(attribute)
  }

  void hasAttribute(String attribute, String value) {
    currentExpectation.hasAttribute(attribute, value)
  }

  void hasAttribute(String attribute, List values) {
    currentExpectation.hasAttribute(attribute, values)
  }

  void hasParent(String parent) {
    currentExpectation.hasParent(parent)
  }

  List getExpectations() {
    return expectations
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy