Tag: partial-mocks

Unit-Tests mit mockito (Teil-Spott)

Anzahl der Antworten 2 Antworten
Ich habe ein problem mit Mockito. Ist es möglich, so etwas zu tun: ClassX x = mock(ClassX.class) when(x.methodB()).thenReturn("toto"); String result = x.methodA(); Arbeite ich mit Mockito 1.7. Ich dort sah, war ein "Spion" - system, aber Sie

wie teilweise mock öffentliche Methode mit PowerMock?

Anzahl der Antworten 3 Antworten
Folgende ist meine Klasse public class SomeClass { public ReturnType1 testThisMethod(Type1 param1, Type2 param2) { //some code helperMethodPublic(param1,param2); //more code follows } public ReturnType2 helperMethodPublic(Type1 param1, Type2 param2) { //some code } } So, in der obigen