snowe
08/27/2020, 6:41 PMprivate String createObjectsWithRetry(final SObject... objects) {
...
id = crudService.createObjects(objects)[0];
...
}
whenever(crudService.createObjects(anyVararg())).thenReturn(listOf("a","b").toTypedArray())
whenever(crudService.createObjects(any<SObject>())).thenReturn(listOf("a","b").toTypedArray())
whenever(crudService.createObjects(any())).thenReturn(listOf("a","b").toTypedArray())
whenever(sfdcCrudService.createSfdcObjects(argThat{true})).thenReturn(listOf("a","b").toTypedArray())
...and more
The result is always null. I would expect all of these to work, but they do not. I cannot figure out what is wrong. It appears it has to do with how Java treats the varargs being passed as a param straight to a new method.mohamadreza jafarzade
08/28/2020, 9:15 AMsnowe
08/28/2020, 6:48 PM