CurrentUserService.java

1
package edu.ucsb.cs156.happiercows.services;
2
3
import java.util.Collection;
4
5
import org.springframework.security.core.GrantedAuthority;
6
7
import edu.ucsb.cs156.happiercows.entities.User;
8
import edu.ucsb.cs156.happiercows.models.CurrentUser;
9
10
public abstract class CurrentUserService {
11
  public abstract User getUser();
12
  public abstract CurrentUser getCurrentUser();
13
  public abstract Collection<? extends GrantedAuthority> getRoles();
14
15
  public final boolean isLoggedIn() {
16 2 1. isLoggedIn : negated conditional → KILLED
2. isLoggedIn : replaced boolean return with true for edu/ucsb/cs156/happiercows/services/CurrentUserService::isLoggedIn → KILLED
    return getUser() != null;
17
  }
18
19
}

Mutations

16

1.1
Location : isLoggedIn
Killed by : edu.ucsb.cs156.happiercows.services.CurrentUserServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.services.CurrentUserServiceTests]/[method:test_isLoggedIn_returns_false()]
negated conditional → KILLED

2.2
Location : isLoggedIn
Killed by : edu.ucsb.cs156.happiercows.services.CurrentUserServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.services.CurrentUserServiceTests]/[method:test_isLoggedIn_returns_false()]
replaced boolean return with true for edu/ucsb/cs156/happiercows/services/CurrentUserService::isLoggedIn → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.3