I normally try to avoid duplication and adhere to the DRY principle. However, I'm wondering about a case like this:
public class Feature {
final static String FEATURE_LABEL = "blah";
public void doSomething() { ... }
...
}
public class FeatureTest {
...
@Test
public void doSomethingShouldMakeSomethingHappen() {
assertEquals(Feature.FEATURE_LABEL,
feature.getSomethingHappens().getLabel());
}
If the requirement is that the the label be "blah" and someone changes FEATURE_LABEL to "bleh", the test will pass even though it no longer meets the requirement. Is this a valid place to violate DRY?