[ 
https://issues.apache.org/jira/browse/SLING-13072?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18054451#comment-18054451
 ] 

Bhavik Kothari commented on SLING-13072:
----------------------------------------

[~sseifert] Thank you :)

> [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)

Reply via email to