This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-models-impl.git


The following commit(s) were added to refs/heads/master by this push:
     new 2d0f287  SLING-11595 Add missing test case for AnnotationConflictsTest 
(#38)
2d0f287 is described below

commit 2d0f287885285b9317766b2af28e9c5e0a0e4d91
Author: Karol Lewandowski <[email protected]>
AuthorDate: Tue Mar 28 11:30:50 2023 +0200

    SLING-11595 Add missing test case for AnnotationConflictsTest (#38)
---
 .../sling/models/impl/AnnotationConflictsTest.java | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git 
a/src/test/java/org/apache/sling/models/impl/AnnotationConflictsTest.java 
b/src/test/java/org/apache/sling/models/impl/AnnotationConflictsTest.java
index 7d74428..c2ae291 100644
--- a/src/test/java/org/apache/sling/models/impl/AnnotationConflictsTest.java
+++ b/src/test/java/org/apache/sling/models/impl/AnnotationConflictsTest.java
@@ -239,6 +239,28 @@ public class AnnotationConflictsTest {
         }
     }
 
+    // @Optional overrides REQUIRED strategy
+    @Model(adaptables = Resource.class)
+    public static class 
SuccessfulSingleOptionalBySeparateAnnotationOverridingStrategyFieldModel 
implements Methods {
+
+        @ValueMapValue
+        private String otherText;
+
+        @Override
+        public String getOtherText() {
+            return otherText;
+        }
+
+        @ValueMapValue(injectionStrategy = InjectionStrategy.REQUIRED)
+        @Optional
+        private String emptyText;
+
+        @Override
+        public String getEmptyText() {
+            return emptyText;
+        }
+    }
+
     private interface Methods {
         String getOtherText();
         String getEmptyText();

Reply via email to