Skip to content

Commit

Permalink
Fixing auto-wiring issues for testing, adding incidents to test entit…
Browse files Browse the repository at this point in the history
…y registry
  • Loading branch information
John Joyce committed Jan 24, 2024
1 parent bdea3b9 commit 8ad46cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ entities:
keyAspect: chartKey
aspects:
- domains
- name: incident
keyAspect: incidentKey
aspects:
- incidentInfo
- status
- name: schemaField
category: core
keyAspect: schemaFieldKey
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.linkedin.gms.factory.incident;

import com.datahub.authentication.Authentication;
import com.linkedin.entity.client.EntityClient;
import com.linkedin.entity.client.SystemEntityClient;
import com.linkedin.gms.factory.auth.SystemAuthenticationFactory;
import com.linkedin.gms.factory.entityclient.RestliEntityClientFactory;
import com.linkedin.metadata.service.IncidentService;
import com.linkedin.metadata.spring.YamlPropertySourceFactory;
import javax.annotation.Nonnull;
Expand All @@ -17,11 +16,8 @@

@Configuration
@PropertySource(value = "classpath:/application.yml", factory = YamlPropertySourceFactory.class)
@Import({SystemAuthenticationFactory.class, RestliEntityClientFactory.class})
@Import({SystemAuthenticationFactory.class})
public class IncidentServiceFactory {
@Autowired
@Qualifier("entityClient")
private EntityClient _entityClient;

@Autowired
@Qualifier("systemAuthentication")
Expand All @@ -30,7 +26,7 @@ public class IncidentServiceFactory {
@Bean(name = "incidentService")
@Scope("singleton")
@Nonnull
protected IncidentService getInstance() throws Exception {
return new IncidentService(_entityClient, _authentication);
protected IncidentService getInstance(final SystemEntityClient entityClient) throws Exception {
return new IncidentService(entityClient, _authentication);
}
}

0 comments on commit 8ad46cc

Please sign in to comment.