GameFeaturesController.java

1
package edu.ucsb.cs156.happiercows.controllers;
2
3
import edu.ucsb.cs156.happiercows.enums.GameFeatures;
4
import io.swagger.v3.oas.annotations.tags.Tag;
5
import io.swagger.v3.oas.annotations.Operation;
6
import lombok.extern.slf4j.Slf4j;
7
import org.springframework.http.ResponseEntity;
8
import org.springframework.web.bind.annotation.GetMapping;
9
import org.springframework.web.bind.annotation.RequestMapping;
10
import org.springframework.web.bind.annotation.RestController;
11
12
import java.util.Arrays;
13
import java.util.List;
14
import java.util.stream.Collectors;
15
16
@Slf4j
17
@Tag(name = "Game Features")
18
@RequestMapping("/api/gamefeatures")
19
@RestController
20
public class GameFeaturesController extends ApiController {
21
22
    @Operation(summary = "List all game features")
23
    @GetMapping("")
24
    public ResponseEntity<List<String>> getGameFeatures() {
25 1 1. getGameFeatures : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/GameFeaturesController::getGameFeatures → KILLED
        return ResponseEntity.ok(
26
            Arrays.stream(GameFeatures.values())
27
                .map(Enum::name)
28
                .collect(Collectors.toList())
29
        );
30
    }
31
}

Mutations

25

1.1
Location : getGameFeatures
Killed by : edu.ucsb.cs156.happiercows.controllers.GameFeaturesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.GameFeaturesControllerTests]/[method:getGameFeatures_returns_list_of_features()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/GameFeaturesController::getGameFeatures → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.1