Hi Allon!
patch in $subject modifies test method name from:
testGetLocaleFromStringString_withDefault
to:
testGetLocaleFromStringStringWithDefault
I've always thought that Java test method names should be
as much readable as possible, because in Java tests, the
method name is used to describe the particular test case.
(Unfortunately, Java test frameworks don't do a good job
in this area.. please correct me if I'm wrong.)
So with JS/Jasmine we can do this:
describe('LocaleUtils', function () {
it('should extract locale from given String', function () {
// actual test code
});
});
but in Java we usually do this:
// <methodName>_<extraInfoForSpecificTestCase>
void testGetLocaleFromStringString_withDefault
which is already far from readable, and this:
testGetLocaleFromStringStringWithDefault
makes it even worse.. Even though it complies with Java
method naming convention, it totally obfuscates what is
that particular test case about, which means people who
want to maintain such tests need to spend time studying
what the test is actually doing..
What's your take on this?
Regards,
Vojtech