ProtocolParamController.java

1
package org.cardanofoundation.explorer.api.controller;
2
3
import java.math.BigInteger;
4
import java.util.List;
5
6
import lombok.AccessLevel;
7
import lombok.RequiredArgsConstructor;
8
import lombok.experimental.FieldDefaults;
9
10
import org.springframework.http.ResponseEntity;
11
import org.springframework.web.bind.annotation.GetMapping;
12
import org.springframework.web.bind.annotation.PathVariable;
13
import org.springframework.web.bind.annotation.RequestMapping;
14
import org.springframework.web.bind.annotation.RequestParam;
15
import org.springframework.web.bind.annotation.RestController;
16
17
import io.swagger.v3.oas.annotations.Operation;
18
import io.swagger.v3.oas.annotations.Parameter;
19
import io.swagger.v3.oas.annotations.tags.Tag;
20
21
import org.cardanofoundation.explorer.api.common.enumeration.ProtocolType;
22
import org.cardanofoundation.explorer.api.config.LogMessage;
23
import org.cardanofoundation.explorer.api.model.response.protocol.FixedProtocol;
24
import org.cardanofoundation.explorer.api.model.response.protocol.HistoriesProtocol;
25
import org.cardanofoundation.explorer.api.model.response.protocol.Protocols;
26
import org.cardanofoundation.explorer.api.service.ProtocolParamService;
27
28
@RestController
29
@RequestMapping("/api/v1/protocols")
30
@RequiredArgsConstructor
31
@FieldDefaults(level = AccessLevel.PRIVATE)
32
@Tag(name = "protocols", description = "The protocols APIs")
33
public class ProtocolParamController {
34
35
  final ProtocolParamService protocolParamService;
36
37
  @GetMapping("/histories/filter/{protocolsTypes}")
38
  @LogMessage
39
  @Operation(
40
      summary = "Get current protocol history change",
41
      tags = {"protocols"})
42
  public ResponseEntity<HistoriesProtocol> getCurrentProtocolWithFilter(
43
      @PathVariable(value = "protocolsTypes", required = false)
44
          @Parameter(description = "protocol want to filter")
45
          List<ProtocolType> protocolTypes,
46
      @RequestParam(value = "startTime", required = false) BigInteger startTime,
47
      @RequestParam(value = "endTime", required = false) BigInteger endTime) {
48
49 1 1. getCurrentProtocolWithFilter : replaced return value with null for org/cardanofoundation/explorer/api/controller/ProtocolParamController::getCurrentProtocolWithFilter → KILLED
    return ResponseEntity.ok(
50
        protocolParamService.getHistoryProtocolParameters(protocolTypes, startTime, endTime));
51
  }
52
53
  @GetMapping("/latest")
54
  @LogMessage
55
  @Operation(
56
      summary = "Get current protocol latest change",
57
      tags = {"protocols"})
58
  public ResponseEntity<Protocols> getLatestChange() {
59 1 1. getLatestChange : replaced return value with null for org/cardanofoundation/explorer/api/controller/ProtocolParamController::getLatestChange → KILLED
    return ResponseEntity.ok(protocolParamService.getLatestChange());
60
  }
61
62
  @GetMapping("/fixed")
63
  @LogMessage
64
  @Operation(
65
      summary = "Get fixed protocols parameters ",
66
      tags = {"protocols"})
67
  public ResponseEntity<FixedProtocol> getFixedProtocols() {
68 1 1. getFixedProtocols : replaced return value with null for org/cardanofoundation/explorer/api/controller/ProtocolParamController::getFixedProtocols → KILLED
    return ResponseEntity.ok(protocolParamService.getFixedProtocols());
69
  }
70
}

Mutations

49

1.1
Location : getCurrentProtocolWithFilter
Killed by : org.cardanofoundation.explorer.api.controller.ProtocolControllerTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.controller.ProtocolControllerTest]/[method:testGetCurrentProtocolWithFilter()]
replaced return value with null for org/cardanofoundation/explorer/api/controller/ProtocolParamController::getCurrentProtocolWithFilter → KILLED

59

1.1
Location : getLatestChange
Killed by : org.cardanofoundation.explorer.api.controller.ProtocolControllerTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.controller.ProtocolControllerTest]/[method:testGetLatestChange()]
replaced return value with null for org/cardanofoundation/explorer/api/controller/ProtocolParamController::getLatestChange → KILLED

68

1.1
Location : getFixedProtocols
Killed by : org.cardanofoundation.explorer.api.controller.ProtocolControllerTest.[engine:junit-jupiter]/[class:org.cardanofoundation.explorer.api.controller.ProtocolControllerTest]/[method:testGetFixedProtocols()]
replaced return value with null for org/cardanofoundation/explorer/api/controller/ProtocolParamController::getFixedProtocols → KILLED

Active mutators

Tests examined


Report generated by PIT 1.14.2