public interface MessageProducer {
public void produce(String message);
public Map<String, Set<String>> getMessagesMapped();
}
public MessageProducerImpl {
@Override
public void produce(String message) {
//code logic here calls private class methods to manipulate messages
}
@Override
public Map<String, Set<String>> getMessagesMapped() {
return map;
}
}
How should one test-drive a scenario like the above and ensure good test coverage when:
- Entry point
produce()
is void complying to contract defined by interface and has no return type. - other methods are
private
in theMessageProducerImpl
class - Not allowed to change interface