| 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 |   public SystemInfo getSystemInfo() { | |
| 33 |     SystemInfo si = | |
| 34 |         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 | } | |
Mutations | ||
| 42 | 
 
 1.1  |