[ 
https://issues.apache.org/jira/browse/SLING-13088?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Seifert resolved SLING-13088.
------------------------------------
    Fix Version/s: Models Implementation 2.0.2
         Assignee: Stefan Seifert
       Resolution: Fixed

[https://github.com/apache/sling-org-apache-sling-models-impl/commit/3ef0e236b2ef9d75afa79e40a773170c6bdc681c]

(without the change to it-launcher.json)

> [Sling Models] Migrate ModelAdapterFactory, Ordering, and OSGi tests to JUnit 
> 5
> -------------------------------------------------------------------------------
>
>                 Key: SLING-13088
>                 URL: https://issues.apache.org/jira/browse/SLING-13088
>             Project: Sling
>          Issue Type: Improvement
>          Components: Sling Models
>            Reporter: Bhavik Kothari
>            Assignee: Stefan Seifert
>            Priority: Major
>              Labels: junit5, models, test
>             Fix For: Models Implementation 2.0.2
>
>
> Continuing the JUnit 5 migration (following SLING-13072).
> This task covers the third batch of the root `org.apache.sling.models.impl` 
> package (files starting M-O).
> Files migrated:
> - ModelAdapterFactory_ImplementationPickerOrderTest
> - ModelAdapterFactory_InjectorOrderTest
> - ModelAdapterFactoryTest
> - ModelPackageBundleListenerTest
> - MultipleInjectorTest
> - OSGiInjectionTest
> - OptionalObjectsTest
> - OptionalPrimitivesTest
> 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
> - Correcting Assertion Argument Order
>  -  Adding {{{}<?>{}}}: Change Type variable to {{Type<?>}} variable
>  -  If {{when(...).thenReturn(...)}} fails with a type error, changing it to 
> {{doReturn(...).when(...).method()}}
> - renaming the local log variable to logger to avoid shadowing the class 
> field.
> - Removing unnecessary eq() usage
> - Removing redundant Throws
> - Cleaning SuppressWarnings and resolved sonar issues with doReturn changes
> - Adding JUnit 5 OSGi dependency and migrating implementation picker & 
> Injector orde test.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to