diff --git a/api/src/main/java/ca/bc/gov/educ/api/graduation/service/RESTService.java b/api/src/main/java/ca/bc/gov/educ/api/graduation/service/RESTService.java index 5f90130e..1a64bd7a 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/graduation/service/RESTService.java +++ b/api/src/main/java/ca/bc/gov/educ/api/graduation/service/RESTService.java @@ -3,7 +3,6 @@ import ca.bc.gov.educ.api.graduation.exception.ServiceException; import ca.bc.gov.educ.api.graduation.util.EducGraduationApiConstants; import ca.bc.gov.educ.api.graduation.util.ThreadLocalStateUtil; -import ca.bc.gov.educ.api.graduation.util.TokenUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.http.HttpStatus; @@ -21,16 +20,14 @@ public class RESTService { private final WebClient webClient; private final WebClient graduationServiceWebClient; - private final TokenUtils tokenUtils; private static final String ERROR_5xx = "5xx error."; private static final String SERVICE_FAILED_ERROR = "Service failed to process after max retries."; @Autowired - public RESTService(@Qualifier("graduationClient") WebClient graduationServiceWebClient, WebClient webClient, TokenUtils tokenUtils) { + public RESTService(@Qualifier("graduationClient") WebClient graduationServiceWebClient, WebClient webClient) { this.webClient = webClient; this.graduationServiceWebClient = graduationServiceWebClient; - this.tokenUtils = tokenUtils; } /** diff --git a/api/src/main/java/ca/bc/gov/educ/api/graduation/service/SchoolReportsService.java b/api/src/main/java/ca/bc/gov/educ/api/graduation/service/SchoolReportsService.java index 27b46a59..640b696b 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/graduation/service/SchoolReportsService.java +++ b/api/src/main/java/ca/bc/gov/educ/api/graduation/service/SchoolReportsService.java @@ -222,7 +222,7 @@ public Integer createAndStoreSchoolLabelsReportsFromSchools(String reportType, L } if (pdfs == null) { String schoolLabelMinCode = (schools != null && schools.size() == 1) ? schools.get(0).getMincode() : "000000000"; - saveDistrictOrSchoolOrLabelsReport(accessToken, schoolLabelMinCode, reportType, reportAsBytes); + saveDistrictOrSchoolOrLabelsReport(schoolLabelMinCode, reportType, reportAsBytes); } reportsCount++; return reportsCount; @@ -284,7 +284,7 @@ private Integer createAndStoreSchoolReports(String reportType, List getAccessToken(String accessToken) { return tokenUtils.getAccessToken(accessToken); } - private String getAccessToken() { - return tokenUtils.getAccessToken(); - } - @SneakyThrows private byte[] mergeDocuments(List sources) { ByteArrayOutputStream tempOutStream = new ByteArrayOutputStream(); diff --git a/api/src/test/resources/application.yaml b/api/src/test/resources/application.yaml index 996af522..a5c9cd3c 100644 --- a/api/src/test/resources/application.yaml +++ b/api/src/test/resources/application.yaml @@ -39,9 +39,6 @@ spring: #Logging properties logging: file: - max-history: 1 - clean-history-on-start: true - max-size: 20MB name: /logs/app.log #pattern: # file: %d | [${HOSTNAME}] | %clr(%5p) | [%t] | %logger{36}:%L | %msg%n @@ -60,6 +57,11 @@ logging: boot: autoconfigure: logging: INFO + logback: + rollingpolicy: + max-history: 1 + clean-history-on-start: true + max-file-size: 20MB authorization: user: batch-api