Created
April 29, 2010 21:13
-
-
Save nhajratw/384259 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Please excuse my embarrassing Groovy code. This is a simplified cuke4duke Step definition. | |
GroceryService is a java class that makes a call to repository.findByNamedQueryAndNamedParam("Store.by_zip_code_with_active_promotions", "zip", "48176") | |
The error i'm getting is: | |
org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: groovy.mock.interceptor.MockFor.findByNamedQueryAndNamedParam() is applicable for argument types: (java.lang.String, java.lang.String, java.lang.String) values: [Store.by_zip_code_with_active_promotions, zip, 48176] (NativeException) | |
When(~"the service is invoked") { | |
store = new Store() | |
stores = new ArrayList() | |
stores.add(store) | |
repository = new MockFor(IRepository) | |
repository.demand.findByNamedQueryAndNamedParam { stores } | |
groceryService.setRepository(repository as IRepository); | |
testData.response = groceryService.getStoresByZipCode(12345, "48176") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment