SystemInfoServiceImpl.java

1
package edu.ucsb.cs156.courses.services;
2
3
import edu.ucsb.cs156.courses.models.SystemInfo;
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
// This class relies on property values
10
// For hints on testing, see: https://www.baeldung.com/spring-boot-testing-configurationproperties
11
12
@Slf4j
13
@Service("systemInfo")
14
@ConfigurationProperties
15
public class SystemInfoServiceImpl extends SystemInfoService {
16
17
  @Value("${spring.h2.console.enabled:false}")
18
  private boolean springH2ConsoleEnabled;
19
20
  @Value("${app.showSwaggerUILink:false}")
21
  private boolean showSwaggerUILink;
22
23
  @Value("${app.startQtrYYYYQ:20221}")
24
  private String startQtrYYYYQ;
25
26
  @Value("${app.endQtrYYYYQ:20222}")
27
  private String endQtrYYYYQ;
28
29
  @Value("${app.sourceRepo:https://github.com/ucsb-cs156/proj-courses}")
30
  private String sourceRepo;
31
32
  @Value("${git.commit.message.short}")
33
  private String commitMessage;
34
35
  @Value("${git.branch}")
36
  private String branch;
37
38
  @Value("${git.commit.id}")
39
  private String commitId;
40
41
  public SystemInfo getSystemInfo() {
42
    SystemInfo si =
43
        SystemInfo.builder()
44
            .springH2ConsoleEnabled(this.springH2ConsoleEnabled)
45
            .showSwaggerUILink(this.showSwaggerUILink)
46
            .startQtrYYYYQ(this.startQtrYYYYQ)
47
            .endQtrYYYYQ(this.endQtrYYYYQ)
48
            .sourceRepo(this.sourceRepo)
49
            .commitMessage(this.commitMessage)
50
            .branch(this.branch)
51
            .commitId(this.commitId)
52
            .build();
53
    log.info("getSystemInfo returns {}", si);
54 1 1. getSystemInfo : replaced return value with null for edu/ucsb/cs156/courses/services/SystemInfoServiceImpl::getSystemInfo → KILLED
    return si;
55
  }
56
}

Mutations

54

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

Active mutators

Tests examined


Report generated by PIT 1.7.3