BAEL-6587 Code for the Mockito Exception article
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package com.baeldung.wantedbutnotinvocked;
|
||||
|
||||
class Helper {
|
||||
|
||||
String getBaeldungString() {
|
||||
return "Baeldung";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.baeldung.wantedbutnotinvocked;
|
||||
|
||||
class Main {
|
||||
|
||||
Helper helper = new Helper();
|
||||
|
||||
String methodUnderTest(int i) {
|
||||
if (i > 5) {
|
||||
return helper.getBaeldungString();
|
||||
}
|
||||
return "Hello";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user