Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions UPGRADE_SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Using GitHub Copilot successfully updated the project to use Java 21 with modern

### Build & Testing Tools
- **JaCoCo**: 0.8.2 → 0.8.12 (Java 21 compatibility fix)
- **JUnit**: 4.13.14.13.2 (security patches)
- **JUnit**: 4.13.25.10.1 (Junit 5 migration)
- **Mockito**: 3.12.4 → 5.11.0 (major version upgrade)

### Logging
Expand Down Expand Up @@ -52,7 +52,7 @@ Updated for Checkstyle 9.x/10.x compatibility:

## Known Issues & Future Work
1. **Checkstyle Violations**: 157 javadoc-related violations need to be addressed in a separate effort
2. **JUnit 5 Migration**: Attempted but blocked by Eclipse/Takari compiler access restrictions with JUnit 5 annotations
~~2. **JUnit 5 Migration**: Attempted but blocked by Eclipse/Takari compiler access restrictions with JUnit 5 annotations~~
3. **Deprecated API Usage**: Some test code uses deprecated Integer constructor (Java 9+)
4. **Java Agent Warnings**: Dynamic agent loading warnings from Mockito/ByteBuddy (Java 21 feature)

Expand Down
33 changes: 30 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<!-- Checkstyle updated to 10.x - existing javadoc violations need fixing separately -->
<checkstyle.fail.on.violation>false</checkstyle.fail.on.violation>
<checkstyle.fail.on.error>false</checkstyle.fail.on.error>
<junit.version>4.13.2</junit.version>
<junit.version>5.10.1</junit.version>
<mockito.version>5.11.0</mockito.version>
<slf4j.version>2.0.12</slf4j.version>
<logback.version>1.5.3</logback.version>
Expand Down Expand Up @@ -67,8 +67,14 @@

<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
Expand All @@ -82,6 +88,21 @@

<build>
<plugins>
<!-- Takari lifecycle plugin configuration -->
<!-- Compiler args needed for future JUnit 5 migration -->
<!-- Eclipse ECJ (used by Takari) restricts access to internal JUnit 5 classes -->
<!-- The add-opens flag allows the compiler to access java.base modules -->
<plugin>
<groupId>io.takari.maven.plugins</groupId>
<artifactId>takari-lifecycle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<compilerId>jdt</compilerId>
<compilerArgs>
<arg>-J--add-opens=java.base/java.lang=ALL-UNNAMED</arg>
</compilerArgs>
</configuration>
</plugin>
<!-- code coverage -->
<plugin>
<groupId>org.jacoco</groupId>
Expand All @@ -108,6 +129,12 @@
</excludes>
</configuration>
</plugin>
<!-- maven-surefire-plugin for JUnit 5 support -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
</plugin>
<!-- checkstyle -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
17 changes: 9 additions & 8 deletions src/test/java/com/walmartlabs/x12/SegmentIteratorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,26 @@

package com.walmartlabs.x12;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.NoSuchElementException;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assertions.assertThrows;

public class SegmentIteratorTest {

@Test(expected = IllegalArgumentException.class)
@Test
public void test_with_null_list() {
List<X12Segment> segmentLines = null;
new SegmentIterator(segmentLines);
assertThrows(IllegalArgumentException.class, () -> new SegmentIterator(segmentLines));
}

@Test
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/com/walmartlabs/x12/X12SegmentTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package com.walmartlabs.x12;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

public class X12SegmentTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

import com.walmartlabs.x12.X12Segment;
import com.walmartlabs.x12.common.segment.DTMDateTimeReference;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

public class DTMDateTimeReferenceParserTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

import com.walmartlabs.x12.X12Segment;
import com.walmartlabs.x12.common.segment.FOBRelatedInstructions;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

public class FOBRelatedInstructionsParserTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

import com.walmartlabs.x12.X12Segment;
import com.walmartlabs.x12.common.segment.LINItemIdentification;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

public class LINItemIdentificationParserTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
import com.walmartlabs.x12.common.segment.N1PartyIdentification;
import com.walmartlabs.x12.common.segment.N3PartyLocation;
import com.walmartlabs.x12.common.segment.N4GeographicLocation;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;
import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class N1PartyIdentificationParserTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

import com.walmartlabs.x12.X12Segment;
import com.walmartlabs.x12.common.segment.PIDProductIdentification;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

public class PIDPartyIdentificationParserTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

import com.walmartlabs.x12.X12Segment;
import com.walmartlabs.x12.common.segment.PKGPackaging;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

public class PKGPackagingParserTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

import com.walmartlabs.x12.X12Segment;
import com.walmartlabs.x12.common.segment.REFReferenceInformation;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

public class REFReferenceInformationParserTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

import com.walmartlabs.x12.X12Segment;
import com.walmartlabs.x12.common.segment.TD1CarrierDetail;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

public class TD1CarrierDetailParserTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

import com.walmartlabs.x12.X12Segment;
import com.walmartlabs.x12.common.segment.TD3CarrierDetail;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

public class TD3CarrierDetailParserTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

import com.walmartlabs.x12.X12Segment;
import com.walmartlabs.x12.common.segment.TD5CarrierDetail;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

public class TD5CarrierDetailParserTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@
import com.walmartlabs.x12.types.InvoiceType;
import com.walmartlabs.x12.types.ProductQualifier;
import com.walmartlabs.x12.types.UnitMeasure;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.util.List;
import java.util.Set;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class DefaultDex894ParseValidateTest {

private DefaultDex894Parser dexParser;
private DefaultDex894Validator dexValidator;

@Before
@BeforeEach
public void init() {
dexParser = new DefaultDex894Parser();
dexValidator = new DefaultDex894Validator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@

import com.walmartlabs.x12.X12Segment;
import com.walmartlabs.x12.exceptions.X12ParserException;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

public class DefaultDex894ParserDxsSegmentTest {

DefaultDex894Parser dexParser;

@Before
@BeforeEach
public void init() {
dexParser = new DefaultDex894Parser();
}
Expand Down Expand Up @@ -121,11 +122,11 @@ public void testParseApplicationTrailerWithMissingControlNumber() {
assertEquals(new Integer(2), dex.getNumberOfTransactions());
}

@Test(expected = X12ParserException.class)
@Test
public void testParseApplicationTrailerWithInvalidCount() {
Dex894 dex = new Dex894();
X12Segment segment = new X12Segment("DXE*1*DX");
dexParser.parseApplicationTrailer(segment, dex);
assertThrows(X12ParserException.class, () -> dexParser.parseApplicationTrailer(segment, dex));
}

}
Loading