Skip to content

CARDS-2175: form-completion-status tests - #1453

Open
sofi2002sofi wants to merge 2 commits into
devfrom
CARDS-2175-form-completion-status-test
Open

CARDS-2175: form-completion-status tests#1453
sofi2002sofi wants to merge 2 commits into
devfrom
CARDS-2175-form-completion-status-test

Conversation

@sofi2002sofi

Copy link
Copy Markdown
Contributor

No description provided.

@sofi2002sofi
sofi2002sofi requested a review from sdumitriu April 12, 2023 15:12
@veronikaslc veronikaslc added the bug Something isn't working label Jun 16, 2023
@veronikaslc

Copy link
Copy Markdown
Contributor

rebased on the latest dev and build, got the output:

FAILURE! - in io.uhndata.cards.formcompletionstatus.AnswerCompletionStatusEditorTest
[ERROR] enterForEmptyFormNode(io.uhndata.cards.formcompletionstatus.AnswerCompletionStatusEditorTest) Time elapsed: 0.338 s <<< FAILURE!
java.lang.AssertionError
at io.uhndata.cards.formcompletionstatus.AnswerCompletionStatusEditorTest.enterForEmptyFormNode(AnswerCompletionStatusEditorTest.java:163)

[ERROR] enterForFormNodeAddsDifferentStatusFlags(io.uhndata.cards.formcompletionstatus.AnswerCompletionStatusEditorTest) Time elapsed: 0.373 s <<< FAILURE!
java.lang.AssertionError
at io.uhndata.cards.formcompletionstatus.AnswerCompletionStatusEditorTest.enterForFormNodeAddsDifferentStatusFlags(AnswerCompletionStatusEditorTest.java:148)

@sofi2002sofi
sofi2002sofi force-pushed the CARDS-2175-form-completion-status-test branch from 865c44d to 8befaf5 Compare July 2, 2023 10:40
@veronikaslc
veronikaslc force-pushed the CARDS-2175-form-completion-status-test branch 2 times, most recently from 0590bc5 to 1e0606e Compare December 6, 2025 06:38
sofi2002sofi and others added 2 commits July 27, 2026 21:21
Modernize the revived tests and complete the module coverage to 100%:
- migrate the tests to the current platform APIs: jakarta.json, Mockito 5,
  sling-mock 4
- drop the Mockito runner in favor of plain mocks with reflection
  injection, since concurrently running runners collide on Mockito's
  global listener registry under the parallel surefire configuration
- raise the sling-mock resource resolver factory timeout, the default
  500ms is not always enough when several Oak-backed test contexts start
  in parallel
- add tests for the previously uncovered classes: RegExpValueValidator,
  RangeMinMaxAnswersValidator, and the AnswerValidator default methods
- cover the previously untested paths: the includes/excludes comparator
  family, empty and multivalued operands, unknown comparators, nested
  answers and questions, broken conditional definitions and values,
  answer options and suggested-only limits in MinMaxValueValidator,
  submitted forms and conditional sections in the completion status
  editor
- extend the date fallback in conditional values: fixed dates that are
  not in the strict JCR format are now parsed with the lenient supported
  formats instead of failing the comparison with a ClassCastException,
  in the spirit of the CARDS-2877 fix
- remove dead code: the never-invoked debugging toString methods, an
  unreachable summarize catch block, and a stream reduce combiner that
  can never run on a sequential stream; guard against sections that
  belong to no questionnaire
- rename the remaining vague test names and drop the meaningless
  constructor smoke test
- remove the module's coverage exemption, restoring the default 1.00
  required instruction coverage ratio
@sdumitriu
sdumitriu force-pushed the CARDS-2175-form-completion-status-test branch from 1e0606e to 0c3a1ec Compare July 27, 2026 23:06
TEST_ANSWER_SECTION_NAME, answerSectionNodeBuilder.getNodeState()));
}

private NodeBuilder getFormNodeBuilderWithAnswerAndAnswerSectionChildren(Object answerValue)
assertFalse(evaluateConditionalWithBrokenFixedValue("date", "2023-01-01"));
}

private boolean evaluateConditionalWithBrokenFixedValue(final String dataType, final String comparableValue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working test-coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants