This is an automated email from the ASF dual-hosted git repository.

ashishvijaywargiya pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git


The following commit(s) were added to refs/heads/trunk by this push:
     new a7c5f96e4 Test cases migration xml to groovy in plugins folder (#267)
a7c5f96e4 is described below

commit a7c5f96e463bcd8c1990970ee9d4c98dce69d281
Author: Ashish Vijaywargiya <[email protected]>
AuthorDate: Mon Jun 1 18:38:52 2026 +0530

    Test cases migration xml to groovy in plugins folder (#267)
    
    Inside the plugins folder:
    
    Migrate Apache OFBiz test suite from JUnit 4 to JUnit 6 (Jupiter)
    
    This commit handles several structural and API changes required for
    upgrading the testing framework from JUnit 4 to JUnit 6.
    
    Key changes include:
    
    Assertions Parameter Order: Updated assertEquals calls to match the new
    JUnit 6 method signature.
    The custom failure message is now passed as the last argument rather
    than the first assertEquals(expected, actual, "message").
    
    Exception Testing Syntax: Updated assertThrows to use JUnit Jupiter API.
    The following import statement has been changed and introduced jupiter
    specific import statement:
    
    import org.junit.Test; --> import org.junit.jupiter.api.Test;
    import org.junit.Before; --> import org.junit.jupiter.api.BeforeEach;
    import org.junit.After; --> import org.junit.jupiter.api.AfterEach;
    import org.junit.BeforeClass; --> import
    org.junit.jupiter.api.BeforeAll;
    import org.junit.AfterClass; --> import org.junit.jupiter.api.AfterAll;
    import org.junit.Ignore; --> import org.junit.jupiter.api.Disabled;
    import org.junit.Assert.; --> import static
    org.junit.jupiter.api.Assertions.;
    
    Additionally, JUnit 4 assertions with failure messages must have their
    parameters swapped because JUnit 4 expects (String message, expected,
    actual) while JUnit 6 Jupiter expects (expected, actual, String
    message):
    
    assertEquals(String, Object, Object) --> assertEquals(Object, Object,
    String)
    assertTrue(String, boolean) --> assertTrue(boolean, String)
    assertFalse(String, boolean) --> assertFalse(boolean, String)
    assertNotNull(String, Object) --> assertNotNull(Object, String)
    assertNull(String, Object) --> assertNull(Object, String)
    assertSame(String, Object, Object) --> assertSame(Object, Object,
    String)
    assertNotSame(String, Object, Object) --> assertNotSame(Object, Object,
    String)
    
    And following changes are also done in this commit:
    
    https://github.com/before
    https://github.com/beforeeach
    @after
    @AfterEach
    
    Important Reference Link:
    https://docs.junit.org/6.1.0/migrating-from-junit4.html

Reply via email to