#bael-3314-new:Update JMockit articles (#14355)

* #bael-3314-new:remove unused method

* #bael-3314-new:change private to protected
This commit is contained in:
Hamid Reza Sharifi 2023-07-18 19:51:58 +03:30 committed by GitHub
parent 66ac6d8816
commit e34fd4fc22
3 changed files with 2 additions and 5 deletions

View File

@ -7,7 +7,7 @@ public class AdvancedCollaborator {
public AdvancedCollaborator(String string) throws Exception{ public AdvancedCollaborator(String string) throws Exception{
i = string.length(); i = string.length();
} }
public String methodThatCallsPrivateMethod(int i){ public String methodThatCallsProtectedMethod(int i){
return protectedMethod() + i; return protectedMethod() + i;
} }
public int methodThatReturnsThePrivateField(){ public int methodThatReturnsThePrivateField(){

View File

@ -20,7 +20,4 @@ public class AppManager {
return new Random().nextInt(7); return new Random().nextInt(7);
} }
private static Integer stringToInteger(String num) {
return Integer.parseInt(num);
}
} }

View File

@ -31,7 +31,7 @@ public class AdvancedCollaboratorIntegrationTest {
return "mocked: "; return "mocked: ";
} }
}; };
String res = mock.methodThatCallsPrivateMethod(1); String res = mock.methodThatCallsProtectedMethod(1);
assertEquals("mocked: 1", res); assertEquals("mocked: 1", res);
} }