| 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.id}") | |
| 33 | private String commitSha; | |
| 34 | ||
| 35 | @Value("${git.commit.message.short}") | |
| 36 | private String commitMessage; | |
| 37 | ||
| 38 | public SystemInfo getSystemInfo() { | |
| 39 | SystemInfo si = | |
| 40 | SystemInfo.builder() | |
| 41 | .springH2ConsoleEnabled(this.springH2ConsoleEnabled) | |
| 42 | .showSwaggerUILink(this.showSwaggerUILink) | |
| 43 | .startQtrYYYYQ(this.startQtrYYYYQ) | |
| 44 | .endQtrYYYYQ(this.endQtrYYYYQ) | |
| 45 | .sourceRepo(this.sourceRepo) | |
| 46 | .commitSha(this.commitSha) | |
| 47 | .commitMessage(this.commitMessage) | |
| 48 | .build(); | |
| 49 | log.info("getSystemInfo returns {}", si); | |
| 50 |
1
1. getSystemInfo : replaced return value with null for edu/ucsb/cs156/courses/services/SystemInfoServiceImpl::getSystemInfo → KILLED |
return si; |
| 51 | } | |
| 52 | } | |
Mutations | ||
| 50 |
1.1 |