[
https://issues.apache.org/jira/browse/SLING-13072?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stefan Seifert resolved SLING-13072.
------------------------------------
Fix Version/s: Models Implementation 2.0.2
Assignee: Stefan Seifert
Resolution: Fixed
https://github.com/apache/sling-org-apache-sling-models-impl/commit/b6cd6bcfebb6e60e77ade9f6899441b438e7e673
thanks!
> [Sling Models] Migrate defaults and inheritance root tests to JUnit 5
> ---------------------------------------------------------------------
>
> Key: SLING-13072
> URL: https://issues.apache.org/jira/browse/SLING-13072
> Project: Sling
> Issue Type: Improvement
> Components: Sling Models
> Reporter: Bhavik Kothari
> Assignee: Stefan Seifert
> Priority: Major
> Labels: Tests, junit5, models
> Fix For: Models Implementation 2.0.2
>
>
> Continuing the JUnit 5 migration (following SLING-13066).
> This task covers the second batch of the root `org.apache.sling.models.impl`
> package (files starting D-I).
> Files:
> - DefaultInterfaceMethodTest
> - DefaultTest
> - ExtraDefaultTests
> - ImplementsExtendsTest
> - InjectorSpecificAnnotationTest
> - InterfaceInheritanceTest
> - InvalidAdaptationsTest
> Changes:
> - Replacing `MockitoJUnitRunner` with `@ExtendWith(MockitoExtension.class)`
> - Updating all imports to `org.junit.jupiter.api`
> - Applying `lenient()` strictness to shared setup method to preserve legacy
> test behavior and prevent `UnnecessaryStubbingException` without altering the
> original test logic
> - using JUnit 5's {{assertThrows}} instead of the JUnit4's
> {{@Test(expected)}} attribute
> - Spliting the large method to multiple method to reduce assertion count per
> method
> - Adding {{{}<?>{}}}: Change Type variable to {{Type<?>}} variable
> - Switching to {{doReturn}} : If {{when(...).thenReturn(...)}} fails with a
> type error, changing it to {{doReturn(...).when(...).method()}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)