SystemInfoServiceImpl.java

1
package edu.ucsb.cs156.happiercows.services;
2
3
4
import lombok.extern.slf4j.Slf4j;
5
import org.springframework.beans.factory.annotation.Value;
6
import org.springframework.boot.context.properties.ConfigurationProperties;
7
import org.springframework.stereotype.Service;
8
9
import edu.ucsb.cs156.happiercows.models.SystemInfo;
10
11
// This class relies on property values
12
// For hints on testing, see: https://www.baeldung.com/spring-boot-testing-configurationproperties
13
14
@Slf4j
15
@Service("systemInfo")
16
@ConfigurationProperties
17
public class SystemInfoServiceImpl extends SystemInfoService {
18
  
19
  @Value("${spring.h2.console.enabled:false}")
20
  private boolean springH2ConsoleEnabled;
21
22
  @Value("${app.showSwaggerUILink:false}")
23
  private boolean showSwaggerUILink;
24
25
  @Value("${app.sourceRepo}")
26
  private String sourceRepo = "https://github.com/ucsb-cs156/proj-happycows";
27
28
  @Value("${app.oauth.login:/oauth2/authorization/google}")
29
  private String oauthLogin;
30
31
  public SystemInfo getSystemInfo() {
32
    SystemInfo si = SystemInfo.builder()
33
    .springH2ConsoleEnabled(this.springH2ConsoleEnabled)
34
    .showSwaggerUILink(this.showSwaggerUILink)
35
    .sourceRepo(this.sourceRepo)
36
    .oauthLogin(this.oauthLogin)
37
    .build();
38
  log.info("getSystemInfo returns {}",si);
39 1 1. getSystemInfo : replaced return value with null for edu/ucsb/cs156/happiercows/services/SystemInfoServiceImpl::getSystemInfo → KILLED
  return si;
40
  }
41
42
}

Mutations

39

1.1
Location : getSystemInfo
Killed by : edu.ucsb.cs156.happiercows.services.SystemInfoServiceImplTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.happiercows.services.SystemInfoServiceImplTests]/[method:test_getSystemInfo()]
replaced return value with null for edu/ucsb/cs156/happiercows/services/SystemInfoServiceImpl::getSystemInfo → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.3