Concordion Concordion Fixtures 2 — Questions and Answers
Question 1: What Java type should a fixture method return if the spec uses concordion:assertTrue?
- boolean or Boolean (Correct answer)
- String
- int
- void
Correct answer: boolean or Boolean
concordion:assertTrue requires the fixture method to return a boolean or Boolean so Concordion can evaluate the condition.
Question 2: How can a Concordion fixture expose a property value to the spec without a method call?
- By declaring a public field or a getter method (Correct answer)
- By writing a concordion:property attribute in the HTML
- By storing the value in a static class
- Fields cannot be accessed; only methods work
Correct answer: By declaring a public field or a getter method
Concordion can access public fields and JavaBean-style getter methods, so both approaches expose values to spec expressions.
Question 3: What should a fixture method return when used with concordion:verifyRows?
- An Iterable of result objects (Correct answer)
- A single String
- A Map of key-value pairs
- A boolean
Correct answer: An Iterable of result objects
concordion:verifyRows expects the fixture method to return an Iterable so Concordion can iterate and compare each item.
Question 4: How does Concordion handle a fixture method that throws an unexpected exception?
- The assertion is marked as an error in the report (Correct answer)
- The entire test suite stops
- The exception is swallowed silently
- The test is retried automatically
Correct answer: The assertion is marked as an error in the report
Unexpected exceptions are caught and displayed as errors (orange/red) in the HTML report for the affected assertion.
Question 5: Which annotation is used in JUnit 5 style Concordion fixtures instead of @RunWith?
- @ExtendWith(ConcordionExtension.class) (Correct answer)
- @ConcordionRunner
- @EnableConcordion
- @ConcordionSpec
Correct answer: @ExtendWith(ConcordionExtension.class)
JUnit 5 style Concordion fixtures use the @ExtendWith(ConcordionExtension.class) annotation provided by the Concordion JUnit 5 module.
Question 6: If a Concordion spec calls greeting(#firstName, #lastName), what must the fixture provide?
- A public method named greeting with two parameters (Correct answer)
- Two separate methods: firstName() and lastName()
- A constructor with two arguments
- A method named greeting() with no parameters
Correct answer: A public method named greeting with two parameters
The fixture must have a public greeting method accepting two parameters that correspond to the #firstName and #lastName variables.
What Java type should a fixture method return if the spec uses concordion:assertTrue?