mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -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.IllegalAbbreviationChars;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.IllegalConfiguration;
|
import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.IllegalConfiguration;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.MissingConfiguration;
|
import org.alfresco.module.org_alfresco_module_rm.classification.ClassificationException.MissingConfiguration;
|
||||||
import org.hamcrest.Matcher;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit tests for the {@link ClassificationLevelValidation}.
|
* Unit tests for the {@link ClassificationLevelValidation}.
|
||||||
@@ -97,11 +95,6 @@ public class ClassificationLevelValidationUnitTest
|
|||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Construct a sequence of Matchers - one for each illegal char we expect to see.
|
assertThat(e.getIllegalChars(), allOf(hasItem('"'), hasItem('*'), hasItem('\\')));
|
||||||
// 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));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user