@Unroll def "createOtherField test to see if label override works #fieldName override(#fieldLabel) == #resultName"() { setup: FormFieldMapManager formFieldMapManager = Mock() String onlineFormId = '1' List<LabelValue> otherFields = [] 1*formFieldMapManager.getMappedFields(onlineFormId, false) >> [new FormFieldMap()] expect: List<LabelValue> result = ProcessorUtil.createOtherField(formFieldMapManager, onlineFormId, otherFields, fieldName, 'fieldValue') result[0].label == resultName where: fieldName | fieldLabel || resultName 'fieldName' | null || 'fieldName' 'fieldName' | '' || 'fieldName' '' | null || '' 'fieldName' | 'OVERRIDE' || 'OVERRIDE' }
Code Snippets, Ideas and Rants from a Tech Lead interested primarily in server side web development and leading teams who build web apps.
Friday, October 14, 2016
Spock data driven testing with interactions (Mocks)
You can do data driven testing with Mocks and interactions, the key is that your interaction should be in the setup: block
For Example
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment