FarmerController.java

1
package edu.ucsb.cs156.happiercows.controllers;
2
3
import com.fasterxml.jackson.core.JsonProcessingException;
4
import com.fasterxml.jackson.databind.ObjectMapper;
5
6
import org.springframework.beans.factory.annotation.Autowired;
7
8
import org.springframework.security.access.prepost.PreAuthorize;
9
import org.springframework.web.bind.annotation.GetMapping;
10
import org.springframework.web.bind.annotation.RequestMapping;
11
import org.springframework.web.bind.annotation.RequestParam;
12
import org.springframework.web.bind.annotation.RestController;
13
14
import edu.ucsb.cs156.happiercows.repositories.FarmerRepository;
15
import edu.ucsb.cs156.happiercows.repositories.GameRepository;
16
import edu.ucsb.cs156.happiercows.entities.User;
17
import edu.ucsb.cs156.happiercows.entities.Farmer;
18
import edu.ucsb.cs156.happiercows.entities.FarmerActivity;
19
import edu.ucsb.cs156.happiercows.entities.Game;
20
import edu.ucsb.cs156.happiercows.errors.EntityNotFoundException;
21
import edu.ucsb.cs156.happiercows.errors.NoCowsException;
22
import edu.ucsb.cs156.happiercows.errors.NotEnoughMoneyException;
23
import edu.ucsb.cs156.happiercows.errors.GameHiddenException;
24
import edu.ucsb.cs156.happiercows.errors.NotEnrolledInCourseAssociatedWithGameException;
25
import edu.ucsb.cs156.happiercows.models.FarmerWithStudentStatus;
26
import edu.ucsb.cs156.happiercows.services.CourseAccessService;
27
import edu.ucsb.cs156.happiercows.services.FarmerActivityService;
28
29
import java.util.ArrayList;
30
import java.util.List;
31
import java.util.Map;
32
33
import io.swagger.v3.oas.annotations.tags.Tag;
34
import io.swagger.v3.oas.annotations.Operation;
35
import io.swagger.v3.oas.annotations.Parameter;
36
37
import org.springframework.http.ResponseEntity;
38
import org.springframework.web.bind.annotation.PutMapping;
39
import org.springframework.transaction.annotation.Transactional;
40
41
import edu.ucsb.cs156.happiercows.entities.CowHerd;
42
import edu.ucsb.cs156.happiercows.repositories.CowHerdRepository;
43
44
45
46
@Tag(name = "User Game")
47
@RequestMapping("/api/farmer")
48
@RestController
49
public class FarmerController extends ApiController {
50
51
  @Autowired
52
  private FarmerRepository farmerRepository;
53
54
55
  @Autowired
56
  private CowHerdRepository cowHerdRepository;
57
58
  @Autowired
59
  private GameRepository gameRepository;
60
61
  @Autowired
62
  ObjectMapper mapper;
63
64
  @Autowired
65
  private CourseAccessService courseAccessService;
66
67
  @Autowired
68
  private FarmerActivityService farmerActivityService;
69
70
  @Operation(summary = "Get a specific user game (admin only)")
71
  @PreAuthorize("hasRole('ROLE_ADMIN')")
72
  @GetMapping("")
73
  public Farmer getFarmerById(
74
      @Parameter(name="userId") @RequestParam Long userId,
75
      @Parameter(name="gameId") @RequestParam Long gameId) throws JsonProcessingException {
76
77
    Farmer farmer = farmerRepository.findByGameIdAndUserId(gameId, userId)
78
        .orElseThrow(
79 1 1. lambda$getFarmerById$0 : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$getFarmerById$0 → KILLED
            () -> new EntityNotFoundException(Farmer.class, "gameId", gameId, "userId", userId));
80 1 1. getFarmerById : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::getFarmerById → KILLED
    return farmer;
81
  }
82
83
  @Operation(summary = "Get a user game for current user")
84
  @PreAuthorize("hasRole('ROLE_USER')")
85
  @GetMapping("/forcurrentuser")
86
  public Farmer getFarmerById(
87
      @Parameter(name="gameId") @RequestParam Long gameId) throws JsonProcessingException {
88
89
    User u = getCurrentUser().getUser();
90
    Long userId = u.getId();
91
    Game game = gameRepository.findById(gameId)
92 1 1. lambda$getFarmerById$1 : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$getFarmerById$1 → KILLED
        .orElseThrow(() -> new EntityNotFoundException("Game", gameId));
93 1 1. getFarmerById : removed call to edu/ucsb/cs156/happiercows/controllers/FarmerController::ensureUserCanAccessCourseLinkedGame → KILLED
    ensureUserCanAccessCourseLinkedGame(u, game);
94
    Farmer farmer = farmerRepository.findByGameIdAndUserId(gameId, userId)
95
        .orElseThrow(
96 1 1. lambda$getFarmerById$2 : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$getFarmerById$2 → KILLED
            () -> new EntityNotFoundException(Farmer.class, "gameId", gameId, "userId", userId));
97 1 1. getFarmerById : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::getFarmerById → KILLED
    return farmer;
98
  }
99
100
  @Operation(summary = "Get all herds for the current farmer")
101
  @PreAuthorize("hasRole('ROLE_USER')")
102
  @GetMapping("/herds")
103
  public List<Map<String, Object>> getFarmerHerds(@RequestParam Long gameId) {
104
    User user = getCurrentUser().getUser();
105
    Long userId = user.getId();
106
107
    Game game = gameRepository.findById(gameId)
108 1 1. lambda$getFarmerHerds$0 : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$getFarmerHerds$0 → KILLED
        .orElseThrow(() -> new EntityNotFoundException("Game", gameId));
109
110 1 1. getFarmerHerds : removed call to edu/ucsb/cs156/happiercows/controllers/FarmerController::ensureUserCanAccessCourseLinkedGame → KILLED
    ensureUserCanAccessCourseLinkedGame(user, game);
111
112 1 1. getFarmerHerds : negated conditional → KILLED
    if (game.isHidden()) {
113
      throw new GameHiddenException(gameId);
114
    }
115
116
    farmerRepository.findByGameIdAndUserId(gameId, userId)
117 1 1. lambda$getFarmerHerds$1 : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$getFarmerHerds$1 → KILLED
        .orElseThrow(() -> new EntityNotFoundException(
118
            Farmer.class, "gameId", gameId, "userId", userId));
119
120
    List<Map<String, Object>> herds = new ArrayList<>();
121
122
    cowHerdRepository.findByFarmer_Id_UserIdAndFarmer_Id_GameId(userId, gameId)
123 1 1. getFarmerHerds : removed call to java/lang/Iterable::forEach → KILLED
        .forEach(herd -> herds.add(Map.of(
124
            "id", herd.getId(),
125
            "numOfCows", herd.getNumOfCows(),
126
            "cowHealth", herd.getCowHealth()
127
        )));
128
129 1 1. getFarmerHerds : replaced return value with Collections.emptyList for edu/ucsb/cs156/happiercows/controllers/FarmerController::getFarmerHerds → KILLED
    return herds;
130
  }
131
132
133
  @Operation(summary = "Buy a cow, totalWealth updated")
134
  @PreAuthorize("hasRole('ROLE_USER')")
135
  @PutMapping("/buy")
136
  public ResponseEntity<String> putFarmerByIdBuy(
137
          @Parameter(name="gameId") @RequestParam Long gameId,
138
          @Parameter(name="numCows") @RequestParam int numCows) throws NotEnoughMoneyException, JsonProcessingException{
139
140
        User u = getCurrentUser().getUser();
141
        Long userId = u.getId();
142
143
        Game game = gameRepository.findById(gameId).orElseThrow( 
144 1 1. lambda$putFarmerByIdBuy$0 : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$putFarmerByIdBuy$0 → KILLED
          ()->new EntityNotFoundException("Game", gameId));
145
146 1 1. putFarmerByIdBuy : removed call to edu/ucsb/cs156/happiercows/controllers/FarmerController::ensureUserCanAccessCourseLinkedGame → KILLED
        ensureUserCanAccessCourseLinkedGame(u, game);
147
148 1 1. putFarmerByIdBuy : negated conditional → KILLED
        if (game.isHidden()) {
149
          throw new GameHiddenException(gameId);
150
        }
151
152
        Farmer farmer = farmerRepository.findByGameIdAndUserId(gameId, userId)
153
        .orElseThrow(
154 1 1. lambda$putFarmerByIdBuy$1 : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$putFarmerByIdBuy$1 → KILLED
            () -> new EntityNotFoundException(Farmer.class, "gameId", gameId, "userId", userId));
155
156 3 1. putFarmerByIdBuy : negated conditional → KILLED
2. putFarmerByIdBuy : changed conditional boundary → KILLED
3. putFarmerByIdBuy : Replaced double multiplication with division → KILLED
        if(farmer.getTotalWealth() >= (game.getCowPrice() * numCows)){
157 3 1. putFarmerByIdBuy : removed call to edu/ucsb/cs156/happiercows/entities/Farmer::setTotalWealth → KILLED
2. putFarmerByIdBuy : Replaced double multiplication with division → KILLED
3. putFarmerByIdBuy : Replaced double subtraction with addition → KILLED
          farmer.setTotalWealth(farmer.getTotalWealth() - (game.getCowPrice() * numCows));
158 2 1. putFarmerByIdBuy : removed call to edu/ucsb/cs156/happiercows/entities/Farmer::setNumOfCows → KILLED
2. putFarmerByIdBuy : Replaced integer addition with subtraction → KILLED
          farmer.setNumOfCows(farmer.getNumOfCows() + numCows);
159 2 1. putFarmerByIdBuy : removed call to edu/ucsb/cs156/happiercows/entities/Farmer::setCowsBought → KILLED
2. putFarmerByIdBuy : Replaced integer addition with subtraction → KILLED
          farmer.setCowsBought(farmer.getCowsBought() + numCows);
160
        }
161
        else{
162
          throw new NotEnoughMoneyException("You need more money!");
163
        }
164
        farmerRepository.save(farmer);
165
        CowHerd herd = CowHerd.builder()
166
            .farmer(farmer)
167
            .numOfCows(numCows)
168
            .cowHealth(100)
169
            .build();
170
171
        cowHerdRepository.save(herd);
172
173 1 1. putFarmerByIdBuy : removed call to edu/ucsb/cs156/happiercows/services/FarmerActivityService::recordActivityIfStudentMatch → KILLED
        farmerActivityService.recordActivityIfStudentMatch(
174
            u, game, farmer, FarmerActivity.ACTIVITY_TYPE_BUY, numCows);
175
176
        String body = mapper.writeValueAsString(farmer);
177 1 1. putFarmerByIdBuy : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::putFarmerByIdBuy → KILLED
        return ResponseEntity.ok().body(body);
178
    }
179
180
  @Operation(summary = "Sell a cow, totalWealth updated")
181
  @PreAuthorize("hasRole('ROLE_USER')")
182
  @PutMapping("/sell")
183
  public ResponseEntity<String> putFarmerByIdSell(
184
          @Parameter(name="gameId") @RequestParam Long gameId,
185
          @Parameter(name="numCows") @RequestParam int numCows) throws NoCowsException, JsonProcessingException {
186
        User u = getCurrentUser().getUser();
187
        Long userId = u.getId();
188
189
        Game game = gameRepository.findById(gameId).orElseThrow( 
190 1 1. lambda$putFarmerByIdSell$0 : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$putFarmerByIdSell$0 → KILLED
          ()->new EntityNotFoundException("Game", gameId));
191
192 1 1. putFarmerByIdSell : removed call to edu/ucsb/cs156/happiercows/controllers/FarmerController::ensureUserCanAccessCourseLinkedGame → KILLED
        ensureUserCanAccessCourseLinkedGame(u, game);
193
194 1 1. putFarmerByIdSell : negated conditional → KILLED
        if (game.isHidden()) {
195
          throw new GameHiddenException(gameId);
196
        }
197
198
        Farmer farmer = farmerRepository.findByGameIdAndUserId(gameId, userId)
199
        .orElseThrow(
200 1 1. lambda$putFarmerByIdSell$1 : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$putFarmerByIdSell$1 → KILLED
            () -> new EntityNotFoundException(Farmer.class, "gameId", gameId, "userId", userId));
201
202
203 2 1. putFarmerByIdSell : negated conditional → KILLED
2. putFarmerByIdSell : changed conditional boundary → KILLED
        if(farmer.getNumOfCows() >= numCows ){
204 2 1. putFarmerByIdSell : Replaced double multiplication with division → KILLED
2. putFarmerByIdSell : Replaced double division with multiplication → KILLED
          double cowValue = game.getCowPrice() * farmer.getCowHealth() / 100;
205 3 1. putFarmerByIdSell : Replaced double addition with subtraction → KILLED
2. putFarmerByIdSell : removed call to edu/ucsb/cs156/happiercows/entities/Farmer::setTotalWealth → KILLED
3. putFarmerByIdSell : Replaced double multiplication with division → KILLED
          farmer.setTotalWealth(farmer.getTotalWealth() + (cowValue * numCows));
206 2 1. putFarmerByIdSell : removed call to edu/ucsb/cs156/happiercows/entities/Farmer::setNumOfCows → KILLED
2. putFarmerByIdSell : Replaced integer subtraction with addition → KILLED
          farmer.setNumOfCows(farmer.getNumOfCows() - numCows);
207 2 1. putFarmerByIdSell : removed call to edu/ucsb/cs156/happiercows/entities/Farmer::setCowsSold → KILLED
2. putFarmerByIdSell : Replaced integer addition with subtraction → KILLED
          farmer.setCowsSold(farmer.getCowsSold() + numCows);
208
        }
209
        else{
210
          throw new NoCowsException("You do not have enough cows to sell!");
211
        }
212
213
        farmerRepository.save(farmer);
214
215 1 1. putFarmerByIdSell : removed call to edu/ucsb/cs156/happiercows/services/FarmerActivityService::recordActivityIfStudentMatch → KILLED
        farmerActivityService.recordActivityIfStudentMatch(
216
            u, game, farmer, FarmerActivity.ACTIVITY_TYPE_SELL, numCows);
217
218
        String body = mapper.writeValueAsString(farmer);
219 1 1. putFarmerByIdSell : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::putFarmerByIdSell → KILLED
        return ResponseEntity.ok().body(body);
220
  }
221
222
  @Operation(summary = "Sell cows from a herd")
223
  @PreAuthorize("hasRole('ROLE_USER')")
224
  @PutMapping("/sell/herd")
225
  @Transactional
226
  public ResponseEntity<String> sellCowsFromHerd(
227
        @RequestParam Long gameId,
228
        @RequestParam Long herdId,
229
        @RequestParam int numCows)
230
        throws NoCowsException, JsonProcessingException {
231
    User u = getCurrentUser().getUser();
232
    Long userId = u.getId();
233
234
    Game game = gameRepository.findById(gameId).orElseThrow(
235 1 1. lambda$sellCowsFromHerd$0 : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$sellCowsFromHerd$0 → KILLED
        () -> new EntityNotFoundException("Game", gameId));
236
237 1 1. sellCowsFromHerd : removed call to edu/ucsb/cs156/happiercows/controllers/FarmerController::ensureUserCanAccessCourseLinkedGame → KILLED
    ensureUserCanAccessCourseLinkedGame(u, game);
238
239 1 1. sellCowsFromHerd : negated conditional → KILLED
    if (game.isHidden()) {
240
        throw new GameHiddenException(gameId);
241
    }
242
243
    Farmer farmer = farmerRepository.findByGameIdAndUserId(gameId, userId)
244 1 1. lambda$sellCowsFromHerd$1 : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$sellCowsFromHerd$1 → KILLED
        .orElseThrow(() -> new EntityNotFoundException(
245
            Farmer.class, "gameId", gameId, "userId", userId));
246
247
    CowHerd herd = cowHerdRepository.findById(herdId)
248 1 1. lambda$sellCowsFromHerd$2 : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$sellCowsFromHerd$2 → KILLED
        .orElseThrow(() -> new EntityNotFoundException("CowHerd", herdId));
249
250 1 1. sellCowsFromHerd : negated conditional → KILLED
    if (herd.getFarmer().getUserId() != userId.longValue()
251 1 1. sellCowsFromHerd : negated conditional → KILLED
            || herd.getFarmer().getGameId() != gameId.longValue()) {
252
        throw new EntityNotFoundException("CowHerd", herdId);
253
    }
254
255 4 1. sellCowsFromHerd : changed conditional boundary → KILLED
2. sellCowsFromHerd : negated conditional → KILLED
3. sellCowsFromHerd : changed conditional boundary → KILLED
4. sellCowsFromHerd : negated conditional → KILLED
    if (numCows <= 0 || numCows > herd.getNumOfCows()
256 2 1. sellCowsFromHerd : negated conditional → KILLED
2. sellCowsFromHerd : changed conditional boundary → KILLED
            || numCows > farmer.getNumOfCows()) {
257
        throw new NoCowsException("You do not have enough cows to sell!");
258
    }
259
260 2 1. sellCowsFromHerd : Replaced double division with multiplication → KILLED
2. sellCowsFromHerd : Replaced double multiplication with division → KILLED
    double cowValue = game.getCowPrice() * herd.getCowHealth() / 100;
261
262 3 1. sellCowsFromHerd : removed call to edu/ucsb/cs156/happiercows/entities/Farmer::setTotalWealth → KILLED
2. sellCowsFromHerd : Replaced double addition with subtraction → KILLED
3. sellCowsFromHerd : Replaced double multiplication with division → KILLED
    farmer.setTotalWealth(farmer.getTotalWealth() + cowValue * numCows);
263 2 1. sellCowsFromHerd : Replaced integer subtraction with addition → KILLED
2. sellCowsFromHerd : removed call to edu/ucsb/cs156/happiercows/entities/Farmer::setNumOfCows → KILLED
    farmer.setNumOfCows(farmer.getNumOfCows() - numCows);
264 2 1. sellCowsFromHerd : Replaced integer addition with subtraction → KILLED
2. sellCowsFromHerd : removed call to edu/ucsb/cs156/happiercows/entities/Farmer::setCowsSold → KILLED
    farmer.setCowsSold(farmer.getCowsSold() + numCows);
265
266 2 1. sellCowsFromHerd : Replaced integer subtraction with addition → KILLED
2. sellCowsFromHerd : removed call to edu/ucsb/cs156/happiercows/entities/CowHerd::setNumOfCows → KILLED
    herd.setNumOfCows(herd.getNumOfCows() - numCows);
267
268
    cowHerdRepository.save(herd);
269
    farmerRepository.save(farmer);
270
271 1 1. sellCowsFromHerd : removed call to edu/ucsb/cs156/happiercows/services/FarmerActivityService::recordActivityIfStudentMatch → KILLED
    farmerActivityService.recordActivityIfStudentMatch(
272
        u, game, farmer, FarmerActivity.ACTIVITY_TYPE_SELL, numCows);
273
274
    String body = mapper.writeValueAsString(farmer);
275 1 1. sellCowsFromHerd : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::sellCowsFromHerd → KILLED
    return ResponseEntity.ok().body(body);
276
  }
277
278
    @Operation(summary = "Get all user game for a specific game")
279
    @PreAuthorize("hasAnyRole('ROLE_USER', 'ROLE_ADMIN')")
280
    @GetMapping("/game/all")
281
    public List<FarmerWithStudentStatus> getFarmersByGameId(
282
        @Parameter(name="gameId") @RequestParam Long gameId) {
283
284
      Game game = gameRepository.findById(gameId)
285 1 1. lambda$getFarmersByGameId$0 : replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$getFarmersByGameId$0 → KILLED
          .orElseThrow(() -> new EntityNotFoundException("Game", gameId));
286
287
      List<FarmerWithStudentStatus> result = new ArrayList<>();
288
      for (Farmer farmer : farmerRepository.findByGameId(gameId)) {
289
        boolean isStudent = courseAccessService
290
            .findMatchingStudentForCourseLinkedGame(farmer.getUser(), game)
291
            .isPresent();
292
293
        result.add(FarmerWithStudentStatus.builder()
294
            .userId(farmer.getUserId())
295
            .gameId(farmer.getGameId())
296
            .username(farmer.getUsername())
297
            .totalWealth(farmer.getTotalWealth())
298
            .numOfCows(farmer.getNumOfCows())
299
            .cowHealth(farmer.getCowHealth())
300
            .cowsBought(farmer.getCowsBought())
301
            .cowsSold(farmer.getCowsSold())
302
            .cowDeaths(farmer.getCowDeaths())
303
            .student(isStudent)
304
            .build());
305
      }
306 1 1. getFarmersByGameId : replaced return value with Collections.emptyList for edu/ucsb/cs156/happiercows/controllers/FarmerController::getFarmersByGameId → KILLED
      return result;
307
  }
308
309
  private void ensureUserCanAccessCourseLinkedGame(User user, Game game) {
310 2 1. ensureUserCanAccessCourseLinkedGame : negated conditional → KILLED
2. ensureUserCanAccessCourseLinkedGame : negated conditional → KILLED
    if (game.getCourseId() != null && !courseAccessService.isEligibleForGame(user, game)) {
311
      throw new NotEnrolledInCourseAssociatedWithGameException();
312
    }
313
  }
314
315
}

Mutations

79

1.1
Location : lambda$getFarmerById$0
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_getFarmerById_nonexists_admin()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$getFarmerById$0 → KILLED

80

1.1
Location : getFarmerById
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_getFarmerById_exists_admin()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::getFarmerById → KILLED

92

1.1
Location : lambda$getFarmerById$1
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_getFarmerById_when_game_does_not_exist()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$getFarmerById$1 → KILLED

93

1.1
Location : getFarmerById
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_getFarmerById_course_linked_game_requires_current_enrollment()]
removed call to edu/ucsb/cs156/happiercows/controllers/FarmerController::ensureUserCanAccessCourseLinkedGame → KILLED

96

1.1
Location : lambda$getFarmerById$2
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_getFarmerById_nonexists()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$getFarmerById$2 → KILLED

97

1.1
Location : getFarmerById
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_getFarmerById_exists()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::getFarmerById → KILLED

108

1.1
Location : lambda$getFarmerHerds$0
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_getFarmerHerds_gameNotFound()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$getFarmerHerds$0 → KILLED

110

1.1
Location : getFarmerHerds
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_getFarmerHerds_courseNotEnrolled()]
removed call to edu/ucsb/cs156/happiercows/controllers/FarmerController::ensureUserCanAccessCourseLinkedGame → KILLED

112

1.1
Location : getFarmerHerds
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_getFarmerHerds_empty()]
negated conditional → KILLED

117

1.1
Location : lambda$getFarmerHerds$1
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_getFarmerHerds_farmerNotFound()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$getFarmerHerds$1 → KILLED

123

1.1
Location : getFarmerHerds
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_getFarmerHerds()]
removed call to java/lang/Iterable::forEach → KILLED

129

1.1
Location : getFarmerHerds
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_getFarmerHerds()]
replaced return value with Collections.emptyList for edu/ucsb/cs156/happiercows/controllers/FarmerController::getFarmerHerds → KILLED

144

1.1
Location : lambda$putFarmerByIdBuy$0
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_buyCow_game_does_not_exist()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$putFarmerByIdBuy$0 → KILLED

146

1.1
Location : putFarmerByIdBuy
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_buyCow_course_linked_game_requires_current_enrollment()]
removed call to edu/ucsb/cs156/happiercows/controllers/FarmerController::ensureUserCanAccessCourseLinkedGame → KILLED

148

1.1
Location : putFarmerByIdBuy
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_buyCow_for_user_not_in_game()]
negated conditional → KILLED

154

1.1
Location : lambda$putFarmerByIdBuy$1
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_buyCow_for_user_not_in_game()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$putFarmerByIdBuy$1 → KILLED

156

1.1
Location : putFarmerByIdBuy
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_BuyCow_not_enough_money()]
negated conditional → KILLED

2.2
Location : putFarmerByIdBuy
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_BuyCow_game_exists_user_has_exact_amount_needed()]
changed conditional boundary → KILLED

3.3
Location : putFarmerByIdBuy
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_BuyCow_not_enough_money()]
Replaced double multiplication with division → KILLED

157

1.1
Location : putFarmerByIdBuy
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_BuyCow_game_exists_user_has_exact_amount_needed()]
removed call to edu/ucsb/cs156/happiercows/entities/Farmer::setTotalWealth → KILLED

2.2
Location : putFarmerByIdBuy
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_BuyCow_course_linked_game_allows_current_enrollment()]
Replaced double multiplication with division → KILLED

3.3
Location : putFarmerByIdBuy
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_BuyCow_game_exists_user_has_exact_amount_needed()]
Replaced double subtraction with addition → KILLED

158

1.1
Location : putFarmerByIdBuy
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_BuyCow_game_exists_user_has_exact_amount_needed()]
removed call to edu/ucsb/cs156/happiercows/entities/Farmer::setNumOfCows → KILLED

2.2
Location : putFarmerByIdBuy
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_BuyCow_game_exists_user_has_exact_amount_needed()]
Replaced integer addition with subtraction → KILLED

159

1.1
Location : putFarmerByIdBuy
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_BuyCow_game_exists_user_has_exact_amount_needed()]
removed call to edu/ucsb/cs156/happiercows/entities/Farmer::setCowsBought → KILLED

2.2
Location : putFarmerByIdBuy
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_BuyCow_game_exists_user_has_exact_amount_needed()]
Replaced integer addition with subtraction → KILLED

173

1.1
Location : putFarmerByIdBuy
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_BuyCow_game_exists()]
removed call to edu/ucsb/cs156/happiercows/services/FarmerActivityService::recordActivityIfStudentMatch → KILLED

177

1.1
Location : putFarmerByIdBuy
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_BuyCow_game_exists_user_has_exact_amount_needed()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::putFarmerByIdBuy → KILLED

190

1.1
Location : lambda$putFarmerByIdSell$0
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_sellCow_game_does_not_exist()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$putFarmerByIdSell$0 → KILLED

192

1.1
Location : putFarmerByIdSell
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCow_course_linked_game_allows_current_enrollment()]
removed call to edu/ucsb/cs156/happiercows/controllers/FarmerController::ensureUserCanAccessCourseLinkedGame → KILLED

194

1.1
Location : putFarmerByIdSell
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_sellCow_for_user_not_in_game()]
negated conditional → KILLED

200

1.1
Location : lambda$putFarmerByIdSell$1
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_sellCow_for_user_not_in_game()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$putFarmerByIdSell$1 → KILLED

203

1.1
Location : putFarmerByIdSell
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCow_game_exists_no_cow_to_sell()]
negated conditional → KILLED

2.2
Location : putFarmerByIdSell
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCow_game_exists()]
changed conditional boundary → KILLED

204

1.1
Location : putFarmerByIdSell
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCow_game_exists()]
Replaced double multiplication with division → KILLED

2.2
Location : putFarmerByIdSell
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCow_game_exists()]
Replaced double division with multiplication → KILLED

205

1.1
Location : putFarmerByIdSell
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCow_game_exists()]
Replaced double addition with subtraction → KILLED

2.2
Location : putFarmerByIdSell
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCow_game_exists()]
removed call to edu/ucsb/cs156/happiercows/entities/Farmer::setTotalWealth → KILLED

3.3
Location : putFarmerByIdSell
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCow_game_exists()]
Replaced double multiplication with division → KILLED

206

1.1
Location : putFarmerByIdSell
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCow_game_exists()]
removed call to edu/ucsb/cs156/happiercows/entities/Farmer::setNumOfCows → KILLED

2.2
Location : putFarmerByIdSell
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCow_game_exists()]
Replaced integer subtraction with addition → KILLED

207

1.1
Location : putFarmerByIdSell
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCow_game_exists()]
removed call to edu/ucsb/cs156/happiercows/entities/Farmer::setCowsSold → KILLED

2.2
Location : putFarmerByIdSell
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCow_game_exists()]
Replaced integer addition with subtraction → KILLED

215

1.1
Location : putFarmerByIdSell
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCow_game_exists()]
removed call to edu/ucsb/cs156/happiercows/services/FarmerActivityService::recordActivityIfStudentMatch → KILLED

219

1.1
Location : putFarmerByIdSell
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCow_game_exists()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::putFarmerByIdSell → KILLED

235

1.1
Location : lambda$sellCowsFromHerd$0
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_gameNotFound()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$sellCowsFromHerd$0 → KILLED

237

1.1
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_courseNotEnrolled()]
removed call to edu/ucsb/cs156/happiercows/controllers/FarmerController::ensureUserCanAccessCourseLinkedGame → KILLED

239

1.1
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_farmerNotFound()]
negated conditional → KILLED

244

1.1
Location : lambda$sellCowsFromHerd$1
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_farmerNotFound()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$sellCowsFromHerd$1 → KILLED

248

1.1
Location : lambda$sellCowsFromHerd$2
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_herdNotFound()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$sellCowsFromHerd$2 → KILLED

250

1.1
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_moreThanFarmerOwns()]
negated conditional → KILLED

251

1.1
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_moreThanFarmerOwns()]
negated conditional → KILLED

255

1.1
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_zeroCows()]
changed conditional boundary → KILLED

2.2
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_sellAllCows()]
negated conditional → KILLED

3.3
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_sellAllCows()]
changed conditional boundary → KILLED

4.4
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_zeroCows()]
negated conditional → KILLED

256

1.1
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_moreThanFarmerOwns()]
negated conditional → KILLED

2.2
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_sellAllCows()]
changed conditional boundary → KILLED

260

1.1
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_sellAllCows()]
Replaced double division with multiplication → KILLED

2.2
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_sellAllCows()]
Replaced double multiplication with division → KILLED

262

1.1
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_sellAllCows()]
removed call to edu/ucsb/cs156/happiercows/entities/Farmer::setTotalWealth → KILLED

2.2
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_sellAllCows()]
Replaced double addition with subtraction → KILLED

3.3
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_sellAllCows()]
Replaced double multiplication with division → KILLED

263

1.1
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_sellAllCows()]
Replaced integer subtraction with addition → KILLED

2.2
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_sellAllCows()]
removed call to edu/ucsb/cs156/happiercows/entities/Farmer::setNumOfCows → KILLED

264

1.1
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_sellAllCows()]
Replaced integer addition with subtraction → KILLED

2.2
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_sellAllCows()]
removed call to edu/ucsb/cs156/happiercows/entities/Farmer::setCowsSold → KILLED

266

1.1
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_sellAllCows()]
Replaced integer subtraction with addition → KILLED

2.2
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd_sellAllCows()]
removed call to edu/ucsb/cs156/happiercows/entities/CowHerd::setNumOfCows → KILLED

271

1.1
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd()]
removed call to edu/ucsb/cs156/happiercows/services/FarmerActivityService::recordActivityIfStudentMatch → KILLED

275

1.1
Location : sellCowsFromHerd
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_SellCowsFromHerd()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::sellCowsFromHerd → KILLED

285

1.1
Location : lambda$getFarmersByGameId$0
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_getAllFarmerById_game_does_not_exist()]
replaced return value with null for edu/ucsb/cs156/happiercows/controllers/FarmerController::lambda$getFarmersByGameId$0 → KILLED

306

1.1
Location : getFarmersByGameId
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_getAllFarmerById_exists()]
replaced return value with Collections.emptyList for edu/ucsb/cs156/happiercows/controllers/FarmerController::getFarmersByGameId → KILLED

310

1.1
Location : ensureUserCanAccessCourseLinkedGame
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_getFarmerHerds_courseNotEnrolled()]
negated conditional → KILLED

2.2
Location : ensureUserCanAccessCourseLinkedGame
Killed by : edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.controllers.FarmerControllerTests]/[method:test_getFarmerHerds_courseNotEnrolled()]
negated conditional → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.1