aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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/");
+ }
}
+
}