Conversation
|
Copyright Validation Results ✅ Valid Files
✅ All files have valid copyright headers! |
There was a problem hiding this comment.
Pull request overview
This PR addresses fixes for bitemporal tests (MLE-27078) in the TestBiTemporal test class, along with various code quality improvements. The changes modernize test assertions, clean up unused code, and make error message validations more flexible.
Changes:
- Updated copyright year to 2026 and changed class visibility from public to package-private
- Modernized test assertions from
assertTrue(x == y)toassertEquals(expected, actual)pattern for better error messages - Improved error message assertions to check partial content rather than exact strings, making tests more resilient to format variations
- Cleaned up unused variables and removed unhelpful debug statements and exception handlers
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| validStartDate.equals("2001-01-01T00:00:00"); | ||
| validEndDate.equals("2011-12-31T23:59:59"); | ||
| systemStartDate.equals("2005-01-01T00:00:01-08:00"); | ||
| systemEndDate.equals("2010-01-01T00:00:01-08:00"); |
There was a problem hiding this comment.
The assertions have been removed, leaving only statements that call equals() but don't check the results. These lines perform no validation and should either be removed entirely or wrapped in assertions. The original assertTrue statement was checking all four conditions together, but now none of the results are being validated.
| validStartDate.equals("2001-01-01T00:00:00"); | |
| validEndDate.equals("2011-12-31T23:59:59"); | |
| systemStartDate.equals("2005-01-01T00:00:01-08:00"); | |
| systemEndDate.equals("2010-01-01T00:00:01-08:00"); | |
| assertEquals("2001-01-01T00:00:00", validStartDate); | |
| assertEquals("2011-12-31T23:59:59", validEndDate); | |
| assertEquals("2005-01-01T00:00:01-08:00", systemStartDate); | |
| assertEquals("2010-01-01T00:00:01-08:00", systemEndDate); |
| DocumentPage termQueryResultsLSQT = docMgrQy.search(periodQueryLSQT, startLSQT); | ||
|
|
||
| assertTrue(termQueryResultsLSQT.getTotalPages() == 0); | ||
| assertTrue(termQueryResultsLSQT.size() == 0); |
There was a problem hiding this comment.
These assertTrue statements with equality checks should be converted to assertEquals for consistency with the changes made elsewhere in this file (e.g., lines 1467-1468, 1495-1496, 1505-1506, 3681-3682). Using assertEquals provides better error messages and follows the modern JUnit assertion pattern.
| assertTrue(termQueryResultsLSQT.size() == 0); | |
| assertEquals(0, termQueryResultsLSQT.size()); |
| import static org.junit.jupiter.api.Assertions.*; | ||
|
|
||
| public class TestBiTemporal extends BasicJavaClientREST { | ||
| class TestBiTemporal extends BasicJavaClientREST { |
There was a problem hiding this comment.
The class visibility was changed from public to package-private. While JUnit 5 allows this, it's inconsistent with other test classes in the same package (e.g., TestBiTempMetaValues, TestAutomatedPathRangeIndex) which are all declared as public. Consider keeping the visibility as public for consistency unless there's a specific reason for this change.
| class TestBiTemporal extends BasicJavaClientREST { | |
| public class TestBiTemporal extends BasicJavaClientREST { |
Lot of small general improvements too.
8d695d1 to
99eb623
Compare
Lot of small general improvements too.