mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-14 18:44:05 +02:00
# Description of Changes Please provide a summary of the changes, including: Refactor test imports and update Gradle file to include all Java files from the src directory --- ## Checklist ### General - [x] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [x] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md) (if applicable) - [x] I have performed a self-review of my own code - [x] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing) for more details.
40 lines
1.0 KiB
Java
40 lines
1.0 KiB
Java
package stirling.software.SPDF;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
import org.junit.jupiter.api.Test;
|
|
import org.junit.jupiter.api.extension.ExtendWith;
|
|
import org.mockito.InjectMocks;
|
|
import org.mockito.Mock;
|
|
import org.mockito.junit.jupiter.MockitoExtension;
|
|
import org.springframework.core.env.Environment;
|
|
|
|
import stirling.software.SPDF.model.ApplicationProperties;
|
|
|
|
@ExtendWith(MockitoExtension.class)
|
|
public class SPDFApplicationTest {
|
|
|
|
@Mock private Environment env;
|
|
|
|
@Mock private ApplicationProperties applicationProperties;
|
|
|
|
@InjectMocks private SPDFApplication sPDFApplication;
|
|
|
|
@BeforeEach
|
|
public void setUp() {
|
|
SPDFApplication.setServerPortStatic("8080");
|
|
}
|
|
|
|
@Test
|
|
public void testSetServerPortStatic() {
|
|
SPDFApplication.setServerPortStatic("9090");
|
|
assertEquals("9090", SPDFApplication.getStaticPort());
|
|
}
|
|
|
|
@Test
|
|
public void testGetStaticPort() {
|
|
assertEquals("8080", SPDFApplication.getStaticPort());
|
|
}
|
|
}
|