@Test public void testInvalidEntity() throws Exception { // tests that class rewrite fails if no parameters are found with a Name specified in the annotation entities field testInvalidEntityHelper(DummyAuthEnforce.AbsentEntityName.class); // tests that class rewrite fails if invalid parameters are found with a Name specified in the annotation entities // field testInvalidEntityHelper(DummyAuthEnforce.InvalidEntityName.class); // test that the class rewrite fails if two parameters are found with the same Name annotation testInvalidEntityHelper(DummyAuthEnforce.DuplicateEntityName.class); // test that the class rewrite fails if less entity parts are provided than needed by enforceOn testInvalidEntityHelper(DummyAuthEnforce.LessMultipleParts.class); // test that the class rewrite fails if more entity parts are provided than needed by enforceOn testInvalidEntityHelper(DummyAuthEnforce.MoreMultipleParts.class); // test that the class rewrite fails if multiple entityId are provided and not strings testInvalidEntityHelper(DummyAuthEnforce.MultipleEntityIds.class); // test that the class rewrite fails if invalid enforceOn entity type is provided testInvalidEntityHelper(DummyAuthEnforce.InvalidAuthEnforceEntityType.class); // test that the class rewrite fails if invalid Annotation is used to annotate a parameter testInvalidEntityHelper(DummyAuthEnforce.InvalidParameterAnnotationType.class); // test that class rewrite fails if two parameter have same annotated name testInvalidEntityHelper(DummyAuthEnforce.DuplicateAnnotationName.class); // test that class rewrite fails if parameter have QueryParam and PathParam with same name testInvalidEntityHelper(DummyAuthEnforce.SameQueryAndPathParam.class); // test that class rewrite fails if multiple part is specified of some other type than String testInvalidEntityHelper(DummyAuthEnforce.EntityWithString.class); // test that class rewrite fails if a blank string is provided in entity parts testInvalidEntityHelper(DummyAuthEnforce.BlankEntityName.class); }