[java-metadata-aggregator] branch master updated: Tidy AssertSupport class
Ian Young
ian at iay.org.uk
Thu Aug 17 10:51:29 EDT 2017
This is an automated email from the git hooks/post-receive script.
iay pushed a commit to branch master
in repository java-metadata-aggregator.
View the commit online:
http://git.shibboleth.net/view/?p=java-metadata-aggregator.git;a=commit;h=78589263700b307fd5bbb8cae9b9901d5a227cf5
The following commit(s) were added to refs/heads/master by this push:
new 7858926 Tidy AssertSupport class
7858926 is described below
commit 78589263700b307fd5bbb8cae9b9901d5a227cf5
Author: Ian Young <ian at iay.org.uk>
AuthorDate: Thu Aug 17 15:51:18 2017 +0100
Tidy AssertSupport class
---
.../java/net/shibboleth/metadata/AssertSupport.java | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/aggregator-pipeline/src/test/java/net/shibboleth/metadata/AssertSupport.java b/aggregator-pipeline/src/test/java/net/shibboleth/metadata/AssertSupport.java
index b80f41d..8c3056d 100644
--- a/aggregator-pipeline/src/test/java/net/shibboleth/metadata/AssertSupport.java
+++ b/aggregator-pipeline/src/test/java/net/shibboleth/metadata/AssertSupport.java
@@ -21,6 +21,7 @@ import java.util.List;
import net.shibboleth.metadata.pipeline.ComponentInfo;
import net.shibboleth.utilities.java.support.component.Component;
+import net.shibboleth.utilities.java.support.logic.Constraint;
import org.testng.Assert;
@@ -41,21 +42,15 @@ public final class AssertSupport {
*/
public static void assertValidComponentInfo(Item<?> metadataElement, int expectedComponentInfos,
Class<? extends Component> expectedComponentType, String expectedComponentId) {
- net.shibboleth.utilities.java.support.logic.Constraint.isNotNull(metadataElement,
- "Metadata element must not be null");
- net.shibboleth.utilities.java.support.logic.Constraint.isGreaterThan(0, expectedComponentInfos,
- "Expected ComponentInfos must be greater than 0");
- net.shibboleth.utilities.java.support.logic.Constraint.isNotNull(expectedComponentType,
- "Expected Component type must not be null");
- net.shibboleth.utilities.java.support.logic.Constraint.isNotNull(expectedComponentId,
- "Expected Component ID must not be null");
+ Constraint.isNotNull(metadataElement, "Metadata element must not be null");
+ Constraint.isGreaterThan(0, expectedComponentInfos, "Expected ComponentInfos must be greater than 0");
+ Constraint.isNotNull(expectedComponentType, "Expected Component type must not be null");
+ Constraint.isNotNull(expectedComponentId, "Expected Component ID must not be null");
- List<ComponentInfo> compInfos = metadataElement.getItemMetadata().get(ComponentInfo.class);
+ final List<ComponentInfo> compInfos = metadataElement.getItemMetadata().get(ComponentInfo.class);
Assert.assertEquals(compInfos.size(), expectedComponentInfos);
- ComponentInfo compInfo;
- for (int i = 0; i < expectedComponentInfos; i++) {
- compInfo = compInfos.get(i);
+ for (final ComponentInfo compInfo : compInfos) {
if (expectedComponentType.equals(compInfo.getComponentType())
&& expectedComponentId.equals(compInfo.getComponentId())) {
Assert.assertNotNull(compInfo.getCompleteInstant());
@@ -66,4 +61,4 @@ public final class AssertSupport {
Assert.fail("Metadata element does not contain a ComponentInfo from a component of type "
+ expectedComponentType.getCanonicalName() + " with an ID of " + expectedComponentId);
}
-}
\ No newline at end of file
+}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list