-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: increase coverage and revision
- Loading branch information
Showing
9 changed files
with
128 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 0 additions & 51 deletions
51
src/main/java/it/finanze/sanita/fse2/ms/gtw/statusmanager/dto/ResponseDTO.java
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
src/main/java/it/finanze/sanita/fse2/ms/gtw/statusmanager/dto/SchedulerResDTO.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/test/java/it/finanze/sanita/fse2/ms/gtw/statusmanager/ConfigItemTypeEnumTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package it.finanze.sanita.fse2.ms.gtw.statusmanager; | ||
|
||
import it.finanze.sanita.fse2.ms.gtw.statusmanager.config.Constants; | ||
import it.finanze.sanita.fse2.ms.gtw.statusmanager.enums.ConfigItemTypeEnum; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.ActiveProfiles; | ||
|
||
import java.util.List; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
@SpringBootTest | ||
@ActiveProfiles(Constants.Profile.TEST) | ||
|
||
@Slf4j | ||
public class ConfigItemTypeEnumTest { | ||
|
||
@Test | ||
public void testPriority() { | ||
// Call the priority method | ||
List<ConfigItemTypeEnum> items = ConfigItemTypeEnum.priority(); | ||
|
||
// Assert that the first item is GENERIC | ||
assertEquals(ConfigItemTypeEnum.GENERIC, items.get(0)); | ||
|
||
// Assert that the last item is GARBAGE | ||
assertEquals(ConfigItemTypeEnum.STATUS_MANAGER, items.get(items.size() - 1)); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/test/java/it/finanze/sanita/fse2/ms/gtw/statusmanager/LivenessCheckCTLTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package it.finanze.sanita.fse2.ms.gtw.statusmanager; | ||
|
||
import it.finanze.sanita.fse2.ms.gtw.statusmanager.config.Constants; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.TestInstance; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.test.context.ActiveProfiles; | ||
import org.springframework.test.web.servlet.MockMvc; | ||
|
||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; | ||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; | ||
|
||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) | ||
@TestInstance(TestInstance.Lifecycle.PER_CLASS) | ||
@ActiveProfiles(Constants.Profile.TEST) | ||
@AutoConfigureMockMvc | ||
public class LivenessCheckCTLTest { | ||
|
||
@Autowired | ||
MockMvc mockMvc; | ||
|
||
@Test | ||
public void testHealthCheck() throws Exception { | ||
mockMvc.perform( | ||
get("/status") | ||
.contentType(MediaType.APPLICATION_JSON)) | ||
.andExpect(status().isOk() | ||
); | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
src/test/java/it/finanze/sanita/fse2/ms/gtw/statusmanager/SchedulerActionCTLTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package it.finanze.sanita.fse2.ms.gtw.statusmanager; | ||
|
||
import it.finanze.sanita.fse2.ms.gtw.statusmanager.config.Constants; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.TestInstance; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.test.context.ActiveProfiles; | ||
import org.springframework.test.web.servlet.MockMvc; | ||
|
||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; | ||
|
||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) | ||
@TestInstance(TestInstance.Lifecycle.PER_CLASS) | ||
@ActiveProfiles(Constants.Profile.TEST) | ||
@AutoConfigureMockMvc | ||
public class SchedulerActionCTLTest { | ||
|
||
@Autowired | ||
MockMvc mockMvc; | ||
|
||
@Test | ||
public void testRunSchedulerAction404() throws Exception { | ||
mockMvc.perform(post("/v1/runStatusScheduler") | ||
.contentType(MediaType.APPLICATION_JSON) | ||
.accept(MediaType.APPLICATION_JSON)); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/test/java/it/finanze/sanita/fse2/ms/gtw/statusmanager/StringUtilityTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package it.finanze.sanita.fse2.ms.gtw.statusmanager; | ||
|
||
import it.finanze.sanita.fse2.ms.gtw.statusmanager.config.Constants; | ||
import it.finanze.sanita.fse2.ms.gtw.statusmanager.utility.StringUtility; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.ActiveProfiles; | ||
import org.springframework.test.context.junit.jupiter.SpringExtension; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
@SpringBootTest | ||
@ActiveProfiles(Constants.Profile.TEST) | ||
@Slf4j | ||
@ExtendWith(SpringExtension.class) | ||
public class StringUtilityTest { | ||
@Test | ||
void testIsNullOrEmpty(){ | ||
assertTrue(StringUtility.isNullOrEmpty(null)); | ||
assertTrue(StringUtility.isNullOrEmpty("")); | ||
assertFalse(StringUtility.isNullOrEmpty("Test")); | ||
} | ||
} |