#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:
parent
66ac6d8816
commit
e34fd4fc22
|
@ -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(){
|
||||||
|
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue