| 1 | package edu.ucsb.cs156.courses.services; | |
| 2 | ||
| 3 | ||
| 4 | import edu.ucsb.cs156.courses.models.SystemInfo; | |
| 5 | import lombok.extern.slf4j.Slf4j; | |
| 6 | import org.springframework.beans.factory.annotation.Value; | |
| 7 | import org.springframework.boot.context.properties.ConfigurationProperties; | |
| 8 | import org.springframework.stereotype.Service; | |
| 9 | ||
| 10 | // This class relies on property values | |
| 11 | // For hints on testing, see: https://www.baeldung.com/spring-boot-testing-configurationproperties | |
| 12 | ||
| 13 | @Slf4j | |
| 14 | @Service("systemInfo") | |
| 15 | @ConfigurationProperties | |
| 16 | public class SystemInfoServiceImpl extends SystemInfoService { | |
| 17 | | |
| 18 | @Value("${spring.h2.console.enabled:false}") | |
| 19 | private boolean springH2ConsoleEnabled; | |
| 20 | ||
| 21 | @Value("${app.showSwaggerUILink:false}") | |
| 22 | private boolean showSwaggerUILink; | |
| 23 | ||
| 24 | @Value("${app.startQtrYYYYQ:20221}") | |
| 25 | private String startQtrYYYYQ; | |
| 26 | ||
| 27 | @Value("${app.endQtrYYYYQ:20222}") | |
| 28 | private String endQtrYYYYQ; | |
| 29 | ||
| 30 | @Value("${app.sourceRepo:https://github.com/ucsb-cs156/proj-courses}") | |
| 31 | private String sourceRepo; | |
| 32 | ||
| 33 | public SystemInfo getSystemInfo() { | |
| 34 | SystemInfo si = SystemInfo.builder() | |
| 35 | .springH2ConsoleEnabled(this.springH2ConsoleEnabled) | |
| 36 | .showSwaggerUILink(this.showSwaggerUILink) | |
| 37 | .startQtrYYYYQ(this.startQtrYYYYQ) | |
| 38 | .endQtrYYYYQ(this.endQtrYYYYQ) | |
| 39 | .sourceRepo(this.sourceRepo) | |
| 40 | .build(); | |
| 41 | log.info("getSystemInfo returns {}",si); | |
| 42 |
1
1. getSystemInfo : replaced return value with null for edu/ucsb/cs156/courses/services/SystemInfoServiceImpl::getSystemInfo → KILLED |
return si; |
| 43 | } | |
| 44 | ||
| 45 | } | |
Mutations | ||
| 42 |
1.1 |