X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Ftest%2FAugmentationVerifier.java;h=45eed6a0695a20ee0bcbc1d1eb9bb6314b96e808;hb=aaea3e9a92ae9d6fac04c4a065db4b35cbca9ed0;hp=227354c41e1f50bfbd62b8edbd82c2928d83d0b3;hpb=6fd408a04fe4a3611843e2246ece6d7c34b76903;p=controller.git diff --git a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/AugmentationVerifier.java b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/AugmentationVerifier.java index 227354c41e..45eed6a069 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/AugmentationVerifier.java +++ b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/AugmentationVerifier.java @@ -7,33 +7,33 @@ */ package org.opendaylight.controller.sal.binding.test; -import junit.framework.Assert; - +import static org.junit.Assert.assertNotNull; import org.opendaylight.yangtools.yang.binding.Augmentable; import org.opendaylight.yangtools.yang.binding.Augmentation; +@Deprecated public class AugmentationVerifier> { - private T object; + private final T object; - public AugmentationVerifier(T objectToVerify) { + public AugmentationVerifier(final T objectToVerify) { this.object = objectToVerify; } - public AugmentationVerifier assertHasAugmentation(Class> augmentation) { + public AugmentationVerifier assertHasAugmentation(final Class> augmentation) { assertHasAugmentation(object, augmentation); - return (AugmentationVerifier) this; + return this; } - public static > void assertHasAugmentation(T object, - Class> augmentation) { - Assert.assertNotNull(object); - Assert.assertNotNull("Augmentation " + augmentation.getSimpleName() + " is not present.", object.getAugmentation(augmentation)); + public static > void assertHasAugmentation(final T object, + final Class> augmentation) { + assertNotNull(object); + assertNotNull("Augmentation " + augmentation.getSimpleName() + " is not present.", + object.augmentation(augmentation)); } - public static > AugmentationVerifier from(T obj) { - return new AugmentationVerifier(obj); + public static > AugmentationVerifier from(final T obj) { + return new AugmentationVerifier<>(obj); } - }