Having a hard time zeroing in on the problem, I'm simplifying everything to narrow things down.
It says it got an unexpected method call, but then says "expected 1, actual 1"
junit.framework.AssertionFailedError: Unexpected method call 'linkOrCreateProperty(apex01.dac9-ejy, "OS", " Text")' 'linkOrCreateProperty(is an instance of com.comcast.neto.chimps.domain.component.Component, is an instance of java.lang.String, is an instance of java.lang.String)': expected 1, actual 1
I believe I have the GMock constructed correctly, yes?
Here's the test code:
def csvDataImportService = new CsvDataImportService()
def propertyService = mock(PropertyService)
csvDataImportService.propertyService.linkOrCreateProperty(is(Component),is(String),is(String)).returns(is(Property))
play {
println "play"
csvDataImportService.importCsvData(fileService)
}
Here's the code that's being mocked:
def prop = propertyService.linkOrCreateProperty( comp, param.key," Text" )
--
- Ed