forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(lineage): add cache key truncation for search lineage key (datahu…
- Loading branch information
1 parent
4ec34fc
commit 90ecdb5
Showing
3 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
metadata-io/src/test/java/com/linkedin/metadata/search/LineageSearchResultCacheKeyTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.linkedin.metadata.search; | ||
|
||
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; | ||
import org.testng.annotations.Test; | ||
|
||
import static org.testng.AssertJUnit.assertEquals; | ||
|
||
|
||
public class LineageSearchResultCacheKeyTest extends AbstractTestNGSpringContextTests { | ||
|
||
@Test | ||
public void testNulls() { | ||
// ensure no NPE | ||
assertEquals(new EntityLineageResultCacheKey(null, null, null, null, null), | ||
EntityLineageResultCacheKey.from(null, null, null, null, null)); | ||
} | ||
|
||
@Test | ||
public void testDateTruncation() { | ||
// expect start of day milli | ||
assertEquals(new EntityLineageResultCacheKey(null, null, 1679529600000L, 1679616000000L, null), | ||
EntityLineageResultCacheKey.from(null, null, 1679530293000L, 1679530293001L, | ||
null)); | ||
} | ||
} |