Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(config): add missing package #11842

Merged
merged 2 commits into from
Nov 12, 2024
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: 4 additions & 0 deletions metadata-service/war/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ dependencies {
implementation externalDependency.awsMskIamAuth
testRuntimeOnly externalDependency.logbackClassic
implementation externalDependency.charle

testImplementation externalDependency.testng
testImplementation externalDependency.springBootTest
testRuntimeOnly externalDependency.logbackClassic
}
configurations.all{
exclude group: "com.charleskorn.kaml", module:"kaml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"com.linkedin.gms.factory.plugins",
"com.linkedin.gms.factory.change",
"com.datahub.event.hook",
"com.linkedin.gms.factory.notifications"
"com.linkedin.gms.factory.notifications",
"com.linkedin.gms.factory.telemetry"
})
@PropertySource(value = "classpath:/application.yaml", factory = YamlPropertySourceFactory.class)
@Configuration
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.linkedin.gms;

import static org.testng.AssertJUnit.assertNotNull;

import com.linkedin.gms.factory.telemetry.DailyReport;
import com.linkedin.metadata.models.registry.ConfigEntityRegistry;
import com.linkedin.metadata.models.registry.EntityRegistry;
import io.ebean.Database;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.annotations.Test;

@SpringBootTest(
webEnvironment = SpringBootTest.WebEnvironment.MOCK,
properties = {"telemetry.enabledServer=true"})
@ContextConfiguration(classes = CommonApplicationConfig.class)
public class SpringTest extends AbstractTestNGSpringContextTests {

// Mock Beans take precedence, we add these to avoid needing to configure data sources etc. while
// still testing prod config
@MockBean private Database database;
@MockBean private ConfigEntityRegistry configEntityRegistry;
@MockBean private EntityRegistry entityRegistry;

@Test
public void testTelemetry() {
DailyReport dailyReport = this.applicationContext.getBean(DailyReport.class);
assertNotNull(dailyReport);
}
}
Loading