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
  @Value("${app.featureFlags:}")
32
  private String featureFlags;
33
34
  public SystemInfo getSystemInfo() {
35
    SystemInfo si = SystemInfo.builder()
36
    .springH2ConsoleEnabled(this.springH2ConsoleEnabled)
37
    .showSwaggerUILink(this.showSwaggerUILink)
38
    .sourceRepo(this.sourceRepo)
39
    .oauthLogin(this.oauthLogin)
40
    .featureFlags(featureFlags)
41
    .build();
42
  log.info("getSystemInfo returns {}",si);
43 1 1. getSystemInfo : replaced return value with null for edu/ucsb/cs156/happiercows/services/SystemInfoServiceImpl::getSystemInfo → KILLED
  return si;
44
  }
45
46
}

Mutations

43

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