1 | package org.cardanofoundation.explorer.api.controller.endpoint; | |
2 | ||
3 | import lombok.RequiredArgsConstructor; | |
4 | ||
5 | import org.springframework.boot.actuate.endpoint.annotation.Endpoint; | |
6 | import org.springframework.boot.actuate.endpoint.annotation.ReadOperation; | |
7 | import org.springframework.context.annotation.Bean; | |
8 | import org.springframework.http.ResponseEntity; | |
9 | import org.springframework.stereotype.Component; | |
10 | ||
11 | import org.cardanofoundation.explorer.api.model.response.healthcheck.SyncStatus; | |
12 | import org.cardanofoundation.explorer.api.service.HealthCheckService; | |
13 | ||
14 | @Endpoint(id = "sync-status") | |
15 | @RequiredArgsConstructor | |
16 | @Component | |
17 | public class SyncStatusEndpoint { | |
18 | ||
19 | private final HealthCheckService healthCheckService; | |
20 | ||
21 | @ReadOperation | |
22 | @Bean | |
23 | public ResponseEntity<SyncStatus> checkSyncStatus() { | |
24 | var syncStatus = healthCheckService.getSyncStatus(); | |
25 |
1
1. checkSyncStatus : negated conditional → NO_COVERAGE |
if (Boolean.FALSE.equals(syncStatus.getIsSyncing())) { |
26 |
1
1. checkSyncStatus : replaced return value with null for org/cardanofoundation/explorer/api/controller/endpoint/SyncStatusEndpoint::checkSyncStatus → NO_COVERAGE |
return ResponseEntity.internalServerError().body(syncStatus); |
27 | } | |
28 | ||
29 |
1
1. checkSyncStatus : replaced return value with null for org/cardanofoundation/explorer/api/controller/endpoint/SyncStatusEndpoint::checkSyncStatus → NO_COVERAGE |
return ResponseEntity.ok().body(syncStatus); |
30 | } | |
31 | } | |
Mutations | ||
25 |
1.1 |
|
26 |
1.1 |
|
29 |
1.1 |