Trying to use EasyMock to test if a protected method gets called, not sure if this is the best way to do it … but given the below, how can I tell that didIgetCalled() actually was called when callMe() was called?
public Class testMe(){
public int callMe(){
if(true){
didIgetCalled();
}
return 1;
}
protected int didIgetCalled(){
return 2;
}
}
This is a way you can test the method without using EasyMock, however my recommendation is that: If it’s not public, don’t write a test for it
I know that this will not entirely solve your problem but it’s a start 🙂