SystemInfoServiceImpl.java

1
package edu.ucsb.cs156.gauchoride.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.gauchoride.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
  public SystemInfo getSystemInfo() {
26
    SystemInfo si = SystemInfo.builder()
27
    .springH2ConsoleEnabled(this.springH2ConsoleEnabled)
28
    .showSwaggerUILink(this.showSwaggerUILink)
29
    .build();
30
  log.info("getSystemInfo returns {}",si);
31 1 1. getSystemInfo : replaced return value with null for edu/ucsb/cs156/gauchoride/services/SystemInfoServiceImpl::getSystemInfo → KILLED
  return si;
32
  }
33
34
}

Mutations

31

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

Active mutators

Tests examined


Report generated by PIT 1.7.3