Slight refactor of test code for improved readability following review. Part of RM-2235.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@105718 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Neil McErlean
2015-06-08 09:30:42 +00:00
parent f8c417d0d0
commit 670fcbfb8d

View File

@@ -29,12 +29,10 @@ import static org.junit.Assert.assertTrue;
import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.IllegalAbbreviationChars;
import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.IllegalConfiguration;
import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.MissingConfiguration;
import org.hamcrest.Matcher;
import org.junit.Test;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
* Unit tests for the {@link ClassificationLevelValidation}.
@@ -97,11 +95,6 @@ public class ClassificationLevelValidationUnitTest
return null;
});
// Construct a sequence of Matchers - one for each illegal char we expect to see.
// Apologies for the Java generics madness here. This is really a List of Matchers of List<Character>
List<Matcher<? super Iterable<? super Character>>> containsCharMatchers = someIllegalChars.stream()
.map(c -> hasItem(c))
.collect(Collectors.toList());
assertThat(e.getIllegalChars(), allOf(containsCharMatchers));
assertThat(e.getIllegalChars(), allOf(hasItem('"'), hasItem('*'), hasItem('\\')));
}
}