Skip to content

Commit 0471057

Browse files
dgurjarci-build
authored andcommitted
fixing code coverage
1 parent 7455f87 commit 0471057

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

bundles/af-core/src/test/java/com/adobe/cq/forms/core/components/internal/models/v1/form/DateTimeImplTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ void testGetConstraintMessages() {
149149
DateTime dateTime = Utils.getComponentUnderTest(PATH_DATETIME_CUSTOMIZED, DateTime.class, context);
150150
Map<ConstraintType, String> constraintsMessages = dateTime.getConstraintMessages();
151151
assertEquals(constraintsMessages.get(ConstraintType.TYPE), "incorrect type");
152+
assertEquals(constraintsMessages.get(ConstraintType.MINIMUM), "Date should be greater than 7th May 2025");
153+
assertEquals(constraintsMessages.get(ConstraintType.MAXIMUM), "Date should be less than 21st May 2025");
152154
DateTime dateTimeMock = Mockito.mock(DateTime.class);
153155
Mockito.when(dateTimeMock.getConstraintMessages()).thenCallRealMethod();
154156
assertEquals(Collections.emptyMap(), dateTimeMock.getConstraintMessages());

bundles/af-core/src/test/resources/form/datetime/exporter-datetime-customized.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"enabled": false,
1212
"lang": "it-IT",
1313
"constraintMessages": {
14-
"type": "incorrect type"
14+
"type": "incorrect type",
15+
"minimum": "minimum message",
16+
"maximum": "maximum message"
1517
},
1618
"readOnly": true,
1719
"default": "2025-05-11T11:21",

bundles/af-core/src/test/resources/form/datetime/test-content.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
"tooltip": "test-short-description",
2929
"minimumDateTime": "2025-05-07T11:21:00.000Z",
3030
"maximumDateTime": "2025-05-21T11:21:00.000Z",
31+
"minimumMessage": "Date should be greater than 7th May 2025",
32+
"maximumMessage": "Date should be less than 21st May 2025",
3133
"default": "2025-05-11T11:21",
3234
"fd:rules" : {
3335
"jcr:primaryType": "nt:unstructured",

0 commit comments

Comments
 (0)