mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Fix failing test on Sonar build.
Avoid calling the I18N utility by checking the display label key directly. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@105312 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -84,4 +84,15 @@ public class ClearanceLevel
|
||||
}
|
||||
|
||||
@Override public int hashCode() { return highestClassificationLevel.hashCode(); }
|
||||
|
||||
/**
|
||||
* Get the display label key. This method is used for unit testing, where we want to avoid problems introduced by
|
||||
* the static call to the I18N utility.
|
||||
*
|
||||
* @return The key for the display label of this security clearance.
|
||||
*/
|
||||
protected String getDisplayLabelKey()
|
||||
{
|
||||
return displayLabelKey;
|
||||
}
|
||||
}
|
||||
|
@@ -235,8 +235,8 @@ public class ClassificationServiceBootstrapUnitTest
|
||||
|
||||
List<ClearanceLevel> clearanceLevels = clearanceLevelCaptor.getValue();
|
||||
assertEquals("There should be one clearance level for each classification level.", classificationLevels.size(), clearanceLevels.size());
|
||||
assertEquals("TopSecret", clearanceLevels.get(0).getDisplayLabel());
|
||||
assertEquals("Secret", clearanceLevels.get(1).getDisplayLabel());
|
||||
assertEquals("rm.classification.noClearance", clearanceLevels.get(2).getDisplayLabel());
|
||||
assertEquals("TopSecret", clearanceLevels.get(0).getDisplayLabelKey());
|
||||
assertEquals("Secret", clearanceLevels.get(1).getDisplayLabelKey());
|
||||
assertEquals("rm.classification.noClearance", clearanceLevels.get(2).getDisplayLabelKey());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user