SystemInfoServiceImpl.java

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

Mutations

35

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

Active mutators

Tests examined


Report generated by PIT 1.7.3