Unit test has to keep its unit, even with FileNet
In Unit Test, there is Unit, and people tends to forget that when writing tests with FileNet. That means your test should not rely on anything else than itself, especially not FileNet. Because then what happens? Your tests fail because the platform is down, the test user credentials changed or a network error occurred, and after a while you’ stop noticing the error, thinking “that’s the platform again, but the method’s fine”, or worst, you end up disabling test on your build, because they are becoming a liability more than a help.
Well, this is not how unit test work, I guess you already know that but still. A unit test has to be perfectly reliable, that’s means if your method produce the right outcome, the test should always pass, no matter what, if the test fail, there is something wrong with the method, and you MUST take a look at what’s wrong, not ignore the failure. If you write true unit test, this should be true and you can enable test in the build, and trust failures as real defects.
I’ll write in another post how to set up PowerMock, and some examples so this one does not become to long.
How to make FileNet development not rely on FileNet
Continue reading →