Skip to content

Commit b5e4f97

Browse files
authored
Merge pull request #1879 from JanardhanBS-SyncByte/issue-1842-consolidate-services
[issue-1842-consolidate-services] Objectmapper removed from WebSubClientConfig.java cuasing issue in id-repo because it does not spring mapper first
2 parents 530c178 + 2d4233f commit b5e4f97

3 files changed

Lines changed: 3 additions & 18 deletions

File tree

‎kernel/kernel-core/src/main/java/io/mosip/kernel/websub/api/client/SubscriberClientImpl.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ public class SubscriberClientImpl
7070
@Autowired
7171
private RestTemplateHelper restTemplateHelper;
7272

73-
@Autowired
74-
private ObjectMapper objectMapper;
73+
/** Local mapper so this library does not register/steal the application {@link ObjectMapper}. */
74+
private final ObjectMapper objectMapper = new ObjectMapper();
7575

7676
/**
7777
* When {@code true}, callback URLs include {@code intentMode} for hub verification

‎kernel/kernel-core/src/main/java/io/mosip/kernel/websub/api/config/WebSubClientConfig.java‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
import jakarta.servlet.Filter;
44

55
import org.springframework.beans.factory.annotation.Autowired;
6-
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
76
import org.springframework.boot.web.servlet.FilterRegistrationBean;
87
import org.springframework.context.annotation.Bean;
98
import org.springframework.context.annotation.Configuration;
109
import org.springframework.context.annotation.EnableAspectJAutoProxy;
1110

12-
import com.fasterxml.jackson.databind.ObjectMapper;
13-
1411
import io.mosip.kernel.core.websub.spi.SubscriptionClient;
1512
import io.mosip.kernel.core.websub.spi.SubscriptionExtendedClient;
1613
import io.mosip.kernel.websub.api.aspects.WebSubClientAspect;
@@ -35,17 +32,6 @@
3532
@EnableAspectJAutoProxy
3633
public class WebSubClientConfig {
3734

38-
/**
39-
* Jackson mapper for failed-content JSON when no application {@link ObjectMapper} exists.
40-
*
41-
* @return new {@link ObjectMapper}
42-
*/
43-
@Bean
44-
@ConditionalOnMissingBean(ObjectMapper.class)
45-
public ObjectMapper objectMapper() {
46-
return new ObjectMapper();
47-
}
48-
4935
/**
5036
* Hub intent-verification helper (topic / mode match).
5137
*

‎kernel/kernel-core/src/test/java/io/mosip/kernel/websub/api/test/subscriber/SubscriberClientApiTest.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ public class SubscriberClientApiTest {
6666

6767
private String expectedFailedContentURL = "http://localhost:9191/hub?topic=demo&callback=aHR0cDovL2xvY2FsaG9zdDo4MDgwL2NhbGxiYWNr&timestamp=2021-08-30T12:39:23.511446100Z&pageindex=0&messageCount=10";
6868

69-
@Autowired
70-
private ObjectMapper objectMapper;
69+
private final ObjectMapper objectMapper = new ObjectMapper();
7170

7271
@Before
7372
public void init() {

0 commit comments

Comments
 (0)