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(kafka): datahub-upgrade job (datahub-project#6864)
- Loading branch information
1 parent
36f2ba0
commit 821bff8
Showing
5 changed files
with
92 additions
and
10 deletions.
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
29 changes: 29 additions & 0 deletions
29
datahub-upgrade/src/test/java/com/linkedin/datahub/upgrade/UpgradeCliApplicationTest.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,29 @@ | ||
package com.linkedin.datahub.upgrade; | ||
|
||
import com.linkedin.datahub.upgrade.restoreindices.RestoreIndices; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.ActiveProfiles; | ||
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; | ||
import org.testng.annotations.Test; | ||
|
||
import javax.inject.Named; | ||
|
||
import static org.testng.AssertJUnit.assertEquals; | ||
|
||
@ActiveProfiles("test") | ||
@SpringBootTest(classes = {UpgradeCliApplication.class, UpgradeCliApplicationTestConfiguration.class}) | ||
public class UpgradeCliApplicationTest extends AbstractTestNGSpringContextTests { | ||
|
||
@Autowired | ||
@Named("restoreIndices") | ||
private RestoreIndices restoreIndices; | ||
|
||
@Test | ||
public void testKafkaHealthCheck() { | ||
/* | ||
This might seem like a simple test however it does exercise the spring autowiring of the kafka health check bean | ||
*/ | ||
assertEquals(3, restoreIndices.steps().size()); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...de/src/test/java/com/linkedin/datahub/upgrade/UpgradeCliApplicationTestConfiguration.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,38 @@ | ||
package com.linkedin.datahub.upgrade; | ||
|
||
import com.linkedin.gms.factory.auth.SystemAuthenticationFactory; | ||
import com.linkedin.metadata.entity.EntityService; | ||
import com.linkedin.metadata.graph.GraphService; | ||
import com.linkedin.metadata.models.registry.ConfigEntityRegistry; | ||
import com.linkedin.metadata.models.registry.EntityRegistry; | ||
import com.linkedin.metadata.search.SearchService; | ||
import io.ebean.EbeanServer; | ||
import org.springframework.boot.test.context.TestConfiguration; | ||
import org.springframework.boot.test.mock.mockito.MockBean; | ||
import org.springframework.context.annotation.Import; | ||
|
||
@TestConfiguration | ||
@Import(value = {SystemAuthenticationFactory.class}) | ||
public class UpgradeCliApplicationTestConfiguration { | ||
|
||
@MockBean | ||
private UpgradeCli upgradeCli; | ||
|
||
@MockBean | ||
private EbeanServer ebeanServer; | ||
|
||
@MockBean | ||
private EntityService entityService; | ||
|
||
@MockBean | ||
private SearchService searchService; | ||
|
||
@MockBean | ||
private GraphService graphService; | ||
|
||
@MockBean | ||
private EntityRegistry entityRegistry; | ||
|
||
@MockBean | ||
ConfigEntityRegistry configEntityRegistry; | ||
} |
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