-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rakhi Agrawal
committed
Oct 9, 2024
1 parent
e224dcf
commit 8bb1ad4
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
dao-api/src/test/java/com/linkedin/metadata/dao/ingestion/preupdate/PreRoutingInfoTest.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,32 @@ | ||
package com.linkedin.metadata.dao.ingestion.preupdate; | ||
|
||
import com.google.protobuf.Message; | ||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.Test; | ||
|
||
import static org.testng.AssertJUnit.*; | ||
import static org.mockito.Mockito.*; | ||
|
||
|
||
public class PreRoutingInfoTest { | ||
private PreRoutingInfo routingInfo; | ||
private PreUpdateRoutingClient<? extends Message> mockPreUpdateClient; | ||
|
||
@BeforeMethod | ||
public void setUp() { | ||
routingInfo = new PreRoutingInfo(); | ||
mockPreUpdateClient = mock(PreUpdateRoutingClient.class); | ||
} | ||
|
||
@Test | ||
public void testPreUpdateClientSetterAndGetter() { | ||
routingInfo.setPreUpdateClient(mockPreUpdateClient); | ||
assertEquals(mockPreUpdateClient, routingInfo.getPreUpdateClient()); | ||
} | ||
|
||
@Test | ||
public void testRoutingActionEnum() { | ||
assertEquals("PROCEED", PreRoutingInfo.RoutingAction.PROCEED.name()); | ||
assertEquals("SKIP", PreRoutingInfo.RoutingAction.SKIP.name()); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...pi/src/test/java/com/linkedin/metadata/dao/ingestion/preupdate/PreUpdateResponseTest.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,23 @@ | ||
package com.linkedin.metadata.dao.ingestion.preupdate; | ||
|
||
import com.linkedin.data.template.RecordTemplate; | ||
import org.testng.annotations.Test; | ||
|
||
import static org.mockito.Mockito.*; | ||
import static org.testng.AssertJUnit.*; | ||
|
||
|
||
public class PreUpdateResponseTest { | ||
|
||
@Test | ||
public void testConstructorAndGetter() { | ||
// Create a mock instance of RecordTemplate | ||
RecordTemplate mockAspect = mock(RecordTemplate.class); | ||
|
||
// Create an instance of PreUpdateResponse with the mock aspect | ||
PreUpdateResponse<RecordTemplate> response = new PreUpdateResponse<>(mockAspect); | ||
|
||
// Verify that the getter returns the correct value | ||
assertEquals(mockAspect, response.getUpdatedAspect()); | ||
} | ||
} |