Skip to content

Commit abcb5b8

Browse files
author
Jorgen-5
committed
Fix error
1 parent 4820226 commit abcb5b8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

klass-api/src/main/java/no/ssb/klass/api/services/IndexServiceImpl.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,18 @@ public class IndexServiceImpl implements IndexService {
5959
private final ClassificationSeriesRepository classificationRepository;
6060
private final OpenSearchRestTemplate elasticsearchOperations;
6161
private final DocumentMapper documentMapper;
62-
private final IndexService indexService;
62+
63+
@Autowired
64+
@Lazy
65+
private IndexService indexService;
6366

6467
@Autowired
6568
public IndexServiceImpl(
6669
ClassificationSeriesRepository classificationRepository,
67-
OpenSearchRestTemplate elasticsearchOperations, IndexService indexService) {
70+
OpenSearchRestTemplate elasticsearchOperations) {
6871
this.classificationRepository = classificationRepository;
6972
this.elasticsearchOperations = elasticsearchOperations;
7073
this.documentMapper = new DocumentMapper();
71-
this.indexService = indexService;
7274
}
7375

7476
private IndexCoordinates getIndexCoordinates() {

klass-api/src/test/java/no/ssb/klass/api/applicationtest/config/IndexServiceTestConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ public OpenSearchRestTemplate openSearchRestTemplate(org.opensearch.client.RestH
2020
@Primary
2121
public IndexService indexService(ClassificationSeriesRepository seriesRepository,
2222
OpenSearchRestTemplate openSearchRestTemplate) {
23-
return new IndexServiceImpl(seriesRepository, openSearchRestTemplate, null);
23+
return new IndexServiceImpl(seriesRepository, openSearchRestTemplate);
2424
}
2525
}

0 commit comments

Comments
 (0)