As I read from Art of unit test, knowing that .NET can hide seam methods for testing in production runtime. (p.78~p.80). Such as,
public class LogAnalyzer
{
...
internal LogAnalyzer (IExtensionManager extentionMgr)
{
manager = extentionMgr;
}
}
run like this.
using System.Runtime.CompilerServices;
[assembly:
InternalsVisibleTo("AOUT.CH3.Logan.Tests")]
So LogAnalyzer() can only be called for test classes, without worries of adding extra cost on production code on purpose of testability. After brief survey, seems Java does not have equivalent feature. But does Java have alternatives? Thanks.