| 1 | package edu.ucsb.cs156.happiercows.controllers; | |
| 2 | ||
| 3 | import edu.ucsb.cs156.happiercows.enums.CommonsFeatures; | |
| 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 = "Commons Features") | |
| 18 | @RequestMapping("/api/commonsfeatures") | |
| 19 | @RestController | |
| 20 | public class CommonsFeaturesController extends ApiController { | |
| 21 | ||
| 22 | @Operation(summary = "List all commons features") | |
| 23 | @GetMapping("") | |
| 24 | public ResponseEntity<List<String>> getCommonsFeatures() { | |
| 25 |
1
1. getCommonsFeatures : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/CommonsFeaturesController::getCommonsFeatures → KILLED |
return ResponseEntity.ok( |
| 26 | Arrays.stream(CommonsFeatures.values()) | |
| 27 | .map(Enum::name) | |
| 28 | .collect(Collectors.toList()) | |
| 29 | ); | |
| 30 | } | |
| 31 | } | |
Mutations | ||
| 25 |
1.1 |