aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2018-03-22 09:42:48 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2018-03-22 10:12:09 -0400
commitcc248780f5e303bf536ea75414af8fbef7805947 (patch)
tree797740e45cf7a328c3fecd84a41287280dbe16e5 /common
parent9b3c49e5f21c7957d91b4e303be61e418934d82d (diff)
updated grm beans test to remove flakey junit
Change-Id: Ie6162a62fb3e61d547a7dfd82f01f194127ac989 Issue-ID: SO-514 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'common')
-rw-r--r--common/src/test/java/org/openecomp/mso/client/grm/GRMBeansTest.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/common/src/test/java/org/openecomp/mso/client/grm/GRMBeansTest.java b/common/src/test/java/org/openecomp/mso/client/grm/GRMBeansTest.java
index ef2d984af4..e22dc7b754 100644
--- a/common/src/test/java/org/openecomp/mso/client/grm/GRMBeansTest.java
+++ b/common/src/test/java/org/openecomp/mso/client/grm/GRMBeansTest.java
@@ -25,6 +25,8 @@ import java.util.List;
import org.junit.Test;
import com.openpojo.reflection.PojoClass;
+import com.openpojo.reflection.PojoClassFilter;
+import com.openpojo.reflection.filters.FilterEnum;
import com.openpojo.reflection.filters.FilterPackageInfo;
import com.openpojo.reflection.impl.PojoClassFactory;
import com.openpojo.validation.Validator;
@@ -36,15 +38,9 @@ import com.openpojo.validation.test.impl.GetterTester;
import com.openpojo.validation.test.impl.SetterTester;
public class GRMBeansTest {
- private static final int EXPECTED_CLASS_COUNT = 10;
private static final String POJO_PACKAGE = "org.openecomp.mso.client.grm.beans";
-
- @Test
- public void ensureExpectedPojoCount() {
- List<PojoClass> pojoClasses = PojoClassFactory.getPojoClasses( POJO_PACKAGE, new FilterPackageInfo());
- Affirm.affirmEquals("Classes added / removed?", EXPECTED_CLASS_COUNT, pojoClasses.size());
- }
-
+ private PojoClassFilter filterTestClasses = new FilterTestClasses();
+
@Test
public void testPojoStructureAndBehavior() {
Validator validator = ValidatorBuilder.create()
@@ -54,6 +50,13 @@ public class GRMBeansTest {
.with(new GetterTester())
.build();
- validator.validate(POJO_PACKAGE, new FilterPackageInfo());
+ validator.validate(POJO_PACKAGE, new FilterPackageInfo(), new FilterEnum(), filterTestClasses);
+ }
+
+ private static class FilterTestClasses implements PojoClassFilter {
+ public boolean include(PojoClass pojoClass) {
+ return !pojoClass.getSourcePath().contains("/test-classes/");
+ }
}
+
}