fixes
This commit is contained in:
@@ -10,6 +10,7 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
@@ -40,7 +41,7 @@ public class SPdfApplication {
|
|||||||
private String baseUrl;
|
private String baseUrl;
|
||||||
|
|
||||||
public SPdfApplication(
|
public SPdfApplication(
|
||||||
Environment env, ApplicationProperties applicationProperties, WebBrowser webBrowser) {
|
Environment env, ApplicationProperties applicationProperties, @Autowired(required = false) WebBrowser webBrowser) {
|
||||||
this.env = env;
|
this.env = env;
|
||||||
this.applicationProperties = applicationProperties;
|
this.applicationProperties = applicationProperties;
|
||||||
this.webBrowser = webBrowser;
|
this.webBrowser = webBrowser;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package stirling.software.SPDF.config;
|
package stirling.software.SPDF.config;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -15,7 +16,7 @@ class AppUpdateService {
|
|||||||
private final ShowAdminInterface showAdmin;
|
private final ShowAdminInterface showAdmin;
|
||||||
|
|
||||||
public AppUpdateService(
|
public AppUpdateService(
|
||||||
ApplicationProperties applicationProperties, ShowAdminInterface showAdmin) {
|
ApplicationProperties applicationProperties, @Autowired(required = false) ShowAdminInterface showAdmin) {
|
||||||
this.applicationProperties = applicationProperties;
|
this.applicationProperties = applicationProperties;
|
||||||
this.showAdmin = showAdmin;
|
this.showAdmin = showAdmin;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import java.util.Map;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpEntity;
|
import org.springframework.http.HttpEntity;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
@@ -34,7 +35,7 @@ public class ApiDocService {
|
|||||||
Map<String, List<String>> outputToFileTypes = new HashMap<>();
|
Map<String, List<String>> outputToFileTypes = new HashMap<>();
|
||||||
JsonNode apiDocsJsonRootNode;
|
JsonNode apiDocsJsonRootNode;
|
||||||
|
|
||||||
public ApiDocService(ServletContext servletContext, UserServiceInterface userService) {
|
public ApiDocService(ServletContext servletContext, @Autowired(required = false) UserServiceInterface userService) {
|
||||||
this.servletContext = servletContext;
|
this.servletContext = servletContext;
|
||||||
this.userService = userService;
|
this.userService = userService;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import java.util.stream.Collectors;
|
|||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipInputStream;
|
import java.util.zip.ZipInputStream;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.core.io.ByteArrayResource;
|
import org.springframework.core.io.ByteArrayResource;
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
import org.springframework.http.*;
|
import org.springframework.http.*;
|
||||||
@@ -46,7 +47,7 @@ public class PipelineProcessor {
|
|||||||
|
|
||||||
public PipelineProcessor(
|
public PipelineProcessor(
|
||||||
ApiDocService apiDocService,
|
ApiDocService apiDocService,
|
||||||
UserServiceInterface userService,
|
@Autowired(required = false) UserServiceInterface userService,
|
||||||
ServletContext servletContext) {
|
ServletContext servletContext) {
|
||||||
this.apiDocService = apiDocService;
|
this.apiDocService = apiDocService;
|
||||||
this.userService = userService;
|
this.userService = userService;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import java.util.*;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
import org.springframework.core.io.ResourceLoader;
|
import org.springframework.core.io.ResourceLoader;
|
||||||
import org.springframework.core.io.support.ResourcePatternUtils;
|
import org.springframework.core.io.support.ResourcePatternUtils;
|
||||||
@@ -36,7 +37,7 @@ public class GeneralWebController {
|
|||||||
private static final String SIGNATURE_BASE_PATH = "customFiles/static/signatures/";
|
private static final String SIGNATURE_BASE_PATH = "customFiles/static/signatures/";
|
||||||
private static final String ALL_USERS_FOLDER = "ALL_USERS";
|
private static final String ALL_USERS_FOLDER = "ALL_USERS";
|
||||||
private final SignatureService signatureService;
|
private final SignatureService signatureService;
|
||||||
private final UserServiceInterface userService;
|
private final @Autowired(required = false) UserServiceInterface userService;
|
||||||
private final ResourceLoader resourceLoader;
|
private final ResourceLoader resourceLoader;
|
||||||
|
|
||||||
public GeneralWebController(
|
public GeneralWebController(
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package stirling.software.SPDF.controller.web;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -19,7 +20,7 @@ public class SignatureController {
|
|||||||
|
|
||||||
private final SignatureService signatureService;
|
private final SignatureService signatureService;
|
||||||
|
|
||||||
private final UserServiceInterface userService;
|
private final @Autowired(required = false) UserServiceInterface userService;
|
||||||
|
|
||||||
public SignatureController(
|
public SignatureController(
|
||||||
SignatureService signatureService, UserServiceInterface userService) {
|
SignatureService signatureService, UserServiceInterface userService) {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import org.mockito.Mock;
|
|||||||
import org.mockito.junit.jupiter.MockitoExtension;
|
import org.mockito.junit.jupiter.MockitoExtension;
|
||||||
import org.springframework.core.env.Environment;
|
import org.springframework.core.env.Environment;
|
||||||
|
|
||||||
|
import stirling.software.SPDF.UI.WebBrowser;
|
||||||
import stirling.software.SPDF.model.ApplicationProperties;
|
import stirling.software.SPDF.model.ApplicationProperties;
|
||||||
|
|
||||||
@ExtendWith(MockitoExtension.class)
|
@ExtendWith(MockitoExtension.class)
|
||||||
@@ -25,13 +26,12 @@ public class SPdfApplicationTest {
|
|||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
private ApplicationProperties applicationProperties;
|
private ApplicationProperties applicationProperties;
|
||||||
|
|
||||||
@InjectMocks
|
@InjectMocks
|
||||||
private SPdfApplication sPdfApplication;
|
private SPdfApplication sPdfApplication;
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
sPdfApplication = new SPdfApplication(env, applicationProperties, null);
|
|
||||||
sPdfApplication.setServerPortStatic("8080");
|
sPdfApplication.setServerPortStatic("8080");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user