Aggiunto OfficeConstants
This commit is contained in:
parent
3fb588f690
commit
9648bbbace
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "epasmed",
|
"name": "epasmed",
|
||||||
"version": "1.0.6",
|
"version": "1.0.7",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "epasmed",
|
"name": "epasmed",
|
||||||
"version": "1.0.5",
|
"version": "1.0.7",
|
||||||
"description": "Description for epasmed",
|
"description": "Description for epasmed",
|
||||||
"private": true,
|
"private": true,
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<groupId>it.cnr.isti.epasmed</groupId>
|
<groupId>it.cnr.isti.epasmed</groupId>
|
||||||
<artifactId>epasmed</artifactId>
|
<artifactId>epasmed</artifactId>
|
||||||
<version>1.0.6</version>
|
<version>1.0.7</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>epasmed</name>
|
<name>epasmed</name>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
package it.cnr.isti.epasmed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* ISTI Office
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class OfficeConstants {
|
||||||
|
|
||||||
|
public static final String ISTI_OFFICE_ID = "657";
|
||||||
|
public static final String ISTI_OFFICE_NAME = "ISTI - Pisa";
|
||||||
|
public static final String ISTI_OFFICE_CODE = "074000";
|
||||||
|
public static final String ISTI_OFFICE_CODEID = "225200";
|
||||||
|
|
||||||
|
}
|
|
@ -13,7 +13,7 @@ import javax.persistence.Table;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A user.
|
* TimeCardsReporting contains year and month
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "timecardsreporting")
|
@Table(name = "timecardsreporting")
|
||||||
|
|
|
@ -26,6 +26,7 @@ import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import it.cnr.isti.epasmed.OfficeConstants;
|
||||||
import it.cnr.isti.epasmed.domain.Leaves;
|
import it.cnr.isti.epasmed.domain.Leaves;
|
||||||
import it.cnr.isti.epasmed.domain.PersOrario;
|
import it.cnr.isti.epasmed.domain.PersOrario;
|
||||||
import it.cnr.isti.epasmed.domain.TabsSI;
|
import it.cnr.isti.epasmed.domain.TabsSI;
|
||||||
|
@ -91,8 +92,7 @@ import it.cnr.isti.epasmed.sistemainformativo.service.SITelefoniService;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class SyncService {
|
public class SyncService {
|
||||||
private static final String ISTI_OFFICE_ID = "1";
|
|
||||||
private static final String ISTI_OFFICE_CODEID = "225200";
|
|
||||||
|
|
||||||
private static final String SI_FLAG_DEL_TRUE = "1";
|
private static final String SI_FLAG_DEL_TRUE = "1";
|
||||||
private static final String SI_FLAG_DEL_FALSE = "0";
|
private static final String SI_FLAG_DEL_FALSE = "0";
|
||||||
|
@ -299,12 +299,12 @@ public class SyncService {
|
||||||
case "telefoni":
|
case "telefoni":
|
||||||
syncTelefoni(tab);
|
syncTelefoni(tab);
|
||||||
break;
|
break;
|
||||||
case "gruppi":
|
//case "gruppi":
|
||||||
syncGruppi(tab);
|
// syncGruppi(tab);
|
||||||
break;
|
// break;
|
||||||
case "gruppo_pers":
|
//case "gruppo_pers":
|
||||||
syncGruppoPers(tab);
|
// syncGruppoPers(tab);
|
||||||
break;
|
// break;
|
||||||
// case "posizioni":
|
// case "posizioni":
|
||||||
// posizioniTab = tab;
|
// posizioniTab = tab;
|
||||||
// break;
|
// break;
|
||||||
|
@ -350,7 +350,7 @@ public class SyncService {
|
||||||
epasPersonsDTO.setFiscalCode(sia.getCodicefiscale());
|
epasPersonsDTO.setFiscalCode(sia.getCodicefiscale());
|
||||||
epasPersonsDTO.setName(sia.getNome());
|
epasPersonsDTO.setName(sia.getNome());
|
||||||
epasPersonsDTO.setSurname(sia.getCognome());
|
epasPersonsDTO.setSurname(sia.getCognome());
|
||||||
epasPersonsDTO.setOfficeId(ISTI_OFFICE_ID);
|
epasPersonsDTO.setOfficeId(OfficeConstants.ISTI_OFFICE_ID);
|
||||||
String email = createCNREmail(sia);
|
String email = createCNREmail(sia);
|
||||||
epasPersonsDTO.setEmail(email);
|
epasPersonsDTO.setEmail(email);
|
||||||
epasPersonsDTO.setQualification(PERSON_DEFAULT_QUALIFICATION);
|
epasPersonsDTO.setQualification(PERSON_DEFAULT_QUALIFICATION);
|
||||||
|
@ -554,7 +554,7 @@ public class SyncService {
|
||||||
if (sig.getId() != null && sig.getId() != 0) {
|
if (sig.getId() != null && sig.getId() != 0) {
|
||||||
if (sig.getFlag_del() != null && !sig.getFlag_del().isEmpty()) {
|
if (sig.getFlag_del() != null && !sig.getFlag_del().isEmpty()) {
|
||||||
if (sig.getFlag_del().compareTo(SI_FLAG_DEL_TRUE) != 0) {
|
if (sig.getFlag_del().compareTo(SI_FLAG_DEL_TRUE) != 0) {
|
||||||
List<EPASGroups> epasGroups = epasGroupsService.getList(ISTI_OFFICE_ID);
|
List<EPASGroups> epasGroups = epasGroupsService.getList(OfficeConstants.ISTI_OFFICE_ID);
|
||||||
if (epasGroups != null) {
|
if (epasGroups != null) {
|
||||||
EPASGroups groupPresent = null;
|
EPASGroups groupPresent = null;
|
||||||
for (EPASGroups g : epasGroups) {
|
for (EPASGroups g : epasGroups) {
|
||||||
|
@ -566,7 +566,7 @@ public class SyncService {
|
||||||
|
|
||||||
if (groupPresent == null) {
|
if (groupPresent == null) {
|
||||||
EPASGroupsDTO epasGroupsDTO = new EPASGroupsDTO(sig.getDescrizione(), null,
|
EPASGroupsDTO epasGroupsDTO = new EPASGroupsDTO(sig.getDescrizione(), null,
|
||||||
String.valueOf(sig.getId()), null, "1", sig.getSigla(), ISTI_OFFICE_ID);
|
String.valueOf(sig.getId()), null, "1", sig.getSigla(), OfficeConstants.ISTI_OFFICE_ID);
|
||||||
EPASGroups epasGroup = epasGroupsService.create(epasGroupsDTO);
|
EPASGroups epasGroup = epasGroupsService.create(epasGroupsDTO);
|
||||||
logger.info("EPAS Created Group: {}", epasGroup);
|
logger.info("EPAS Created Group: {}", epasGroup);
|
||||||
} else {
|
} else {
|
||||||
|
@ -575,19 +575,19 @@ public class SyncService {
|
||||||
epasGroupsDTO.setDescription(sig.getDescrizione());
|
epasGroupsDTO.setDescription(sig.getDescrizione());
|
||||||
epasGroupsDTO.setName(sig.getSigla());
|
epasGroupsDTO.setName(sig.getSigla());
|
||||||
if (epasGroupsDTO.getOfficeId() == null || epasGroupsDTO.getOfficeId().isEmpty()) {
|
if (epasGroupsDTO.getOfficeId() == null || epasGroupsDTO.getOfficeId().isEmpty()) {
|
||||||
epasGroupsDTO.setOfficeId(ISTI_OFFICE_ID);
|
epasGroupsDTO.setOfficeId(OfficeConstants.ISTI_OFFICE_ID);
|
||||||
}
|
}
|
||||||
epasGroupsService.updateById(groupPresent.getId(), epasGroupsDTO);
|
epasGroupsService.updateById(groupPresent.getId(), epasGroupsDTO);
|
||||||
logger.info("EPAS Updated Group: {}", epasGroupsDTO);
|
logger.info("EPAS Updated Group: {}", epasGroupsDTO);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
EPASGroupsDTO epasGroupsDTO = new EPASGroupsDTO(sig.getDescrizione(), null,
|
EPASGroupsDTO epasGroupsDTO = new EPASGroupsDTO(sig.getDescrizione(), null,
|
||||||
String.valueOf(sig.getId()), null, null, sig.getSigla(), ISTI_OFFICE_ID);
|
String.valueOf(sig.getId()), null, null, sig.getSigla(), OfficeConstants.ISTI_OFFICE_ID);
|
||||||
EPASGroups epasGroup = epasGroupsService.create(epasGroupsDTO);
|
EPASGroups epasGroup = epasGroupsService.create(epasGroupsDTO);
|
||||||
logger.info("EPAS Created Group: {}", epasGroup);
|
logger.info("EPAS Created Group: {}", epasGroup);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
List<EPASGroups> epasGroups = epasGroupsService.getList(ISTI_OFFICE_ID);
|
List<EPASGroups> epasGroups = epasGroupsService.getList(OfficeConstants.ISTI_OFFICE_ID);
|
||||||
if (epasGroups != null) {
|
if (epasGroups != null) {
|
||||||
EPASGroups groupPresent = null;
|
EPASGroups groupPresent = null;
|
||||||
for (EPASGroups g : epasGroups) {
|
for (EPASGroups g : epasGroups) {
|
||||||
|
@ -606,7 +606,7 @@ public class SyncService {
|
||||||
EPASGroupsDTO epasGroupsDTO = epasGroupsMapper
|
EPASGroupsDTO epasGroupsDTO = epasGroupsMapper
|
||||||
.epasGroupsToEPASGroupsDTO(groupPresent);
|
.epasGroupsToEPASGroupsDTO(groupPresent);
|
||||||
if (epasGroupsDTO.getOfficeId() == null || epasGroupsDTO.getOfficeId().isEmpty()) {
|
if (epasGroupsDTO.getOfficeId() == null || epasGroupsDTO.getOfficeId().isEmpty()) {
|
||||||
epasGroupsDTO.setOfficeId(ISTI_OFFICE_ID);
|
epasGroupsDTO.setOfficeId(OfficeConstants.ISTI_OFFICE_ID);
|
||||||
}
|
}
|
||||||
epasGroupsService.updateById(groupPresent.getId(), epasGroupsDTO);
|
epasGroupsService.updateById(groupPresent.getId(), epasGroupsDTO);
|
||||||
logger.info("EPAS Delete Group: {}", epasGroupsDTO);
|
logger.info("EPAS Delete Group: {}", epasGroupsDTO);
|
||||||
|
@ -712,7 +712,7 @@ public class SyncService {
|
||||||
|
|
||||||
private void gestisciDipendenteNonAffiliato(SIGruppiPers sigp) {
|
private void gestisciDipendenteNonAffiliato(SIGruppiPers sigp) {
|
||||||
logger.debug("Aggiungi dipendente non affiliato");
|
logger.debug("Aggiungi dipendente non affiliato");
|
||||||
List<EPASGroups> epasGroups = epasGroupsService.getList(ISTI_OFFICE_ID);
|
List<EPASGroups> epasGroups = epasGroupsService.getList(OfficeConstants.ISTI_OFFICE_ID);
|
||||||
EPASGroups groupPresent = null;
|
EPASGroups groupPresent = null;
|
||||||
if (epasGroups != null) {
|
if (epasGroups != null) {
|
||||||
for (EPASGroups g : epasGroups) {
|
for (EPASGroups g : epasGroups) {
|
||||||
|
@ -769,7 +769,7 @@ public class SyncService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (affPresent != null) {
|
if (affPresent != null) {
|
||||||
List<EPASGroups> epasGroups = epasGroupsService.getList(ISTI_OFFICE_ID);
|
List<EPASGroups> epasGroups = epasGroupsService.getList(OfficeConstants.ISTI_OFFICE_ID);
|
||||||
EPASGroups groupPresent = null;
|
EPASGroups groupPresent = null;
|
||||||
if (epasGroups != null) {
|
if (epasGroups != null) {
|
||||||
for (EPASGroups g : epasGroups) {
|
for (EPASGroups g : epasGroups) {
|
||||||
|
@ -1154,7 +1154,7 @@ public class SyncService {
|
||||||
LocalDateTime lastUpdate = tab.getLastUpdate();
|
LocalDateTime lastUpdate = tab.getLastUpdate();
|
||||||
LocalDateTime maxLastUpdate = null;
|
LocalDateTime maxLastUpdate = null;
|
||||||
|
|
||||||
List<EPASWorkingTimeTypes> eWTTs = epasWorkingTimeTypesService.getListByOfficeCodeId(ISTI_OFFICE_CODEID);
|
List<EPASWorkingTimeTypes> eWTTs = epasWorkingTimeTypesService.getListByOfficeCodeId(OfficeConstants.ISTI_OFFICE_CODEID);
|
||||||
for (EPASWorkingTimeTypes eWTT : eWTTs) {
|
for (EPASWorkingTimeTypes eWTT : eWTTs) {
|
||||||
// "2021-02-03T09:49:05.231072"
|
// "2021-02-03T09:49:05.231072"
|
||||||
DateTimeFormatter formatter = new DateTimeFormatterBuilder().parseCaseInsensitive()
|
DateTimeFormatter formatter = new DateTimeFormatterBuilder().parseCaseInsensitive()
|
||||||
|
@ -1199,7 +1199,7 @@ public class SyncService {
|
||||||
|
|
||||||
logger.info("Reference: {}-{}", year, month);
|
logger.info("Reference: {}-{}", year, month);
|
||||||
|
|
||||||
List<EPASOffSiteWorks> epasOffSiteWorksList = epasOffSiteWorksService.getListByOfficeCodeId(ISTI_OFFICE_CODEID,
|
List<EPASOffSiteWorks> epasOffSiteWorksList = epasOffSiteWorksService.getListByOfficeCodeId(OfficeConstants.ISTI_OFFICE_CODEID,
|
||||||
year, month);
|
year, month);
|
||||||
|
|
||||||
if (epasOffSiteWorksList == null || epasOffSiteWorksList.isEmpty()) {
|
if (epasOffSiteWorksList == null || epasOffSiteWorksList.isEmpty()) {
|
||||||
|
@ -1316,9 +1316,9 @@ public class SyncService {
|
||||||
nextYear = nextYear + 1;
|
nextYear = nextYear + 1;
|
||||||
logger.debug("Next Year: {}", nextYear.toString());
|
logger.debug("Next Year: {}", nextYear.toString());
|
||||||
|
|
||||||
List<EPASLeaves> epasLeavesList = epasLeavesService.getLeavesByOfficeId(ISTI_OFFICE_ID, year, "true");
|
List<EPASLeaves> epasLeavesList = epasLeavesService.getLeavesByOfficeId(OfficeConstants.ISTI_OFFICE_ID, year, "true");
|
||||||
logger.debug("Current Year Leaves: {}", epasLeavesList);
|
logger.debug("Current Year Leaves: {}", epasLeavesList);
|
||||||
List<EPASLeaves> epasLeavesNextList = epasLeavesService.getLeavesByOfficeId(ISTI_OFFICE_ID, nextYear.toString(),
|
List<EPASLeaves> epasLeavesNextList = epasLeavesService.getLeavesByOfficeId(OfficeConstants.ISTI_OFFICE_ID, nextYear.toString(),
|
||||||
"true");
|
"true");
|
||||||
logger.debug("Next Year Leaves: {}", epasLeavesNextList);
|
logger.debug("Next Year Leaves: {}", epasLeavesNextList);
|
||||||
|
|
||||||
|
@ -1495,7 +1495,7 @@ public class SyncService {
|
||||||
logger.info("Reference: {}-{}", year, month);
|
logger.info("Reference: {}-{}", year, month);
|
||||||
|
|
||||||
List<EPASPersonWorkingTimeDTO> epasPersonWorkingTimeDTOList = epasPersonWorkingTimeService
|
List<EPASPersonWorkingTimeDTO> epasPersonWorkingTimeDTOList = epasPersonWorkingTimeService
|
||||||
.getList(ISTI_OFFICE_ID);
|
.getList(OfficeConstants.ISTI_OFFICE_ID);
|
||||||
|
|
||||||
if (epasPersonWorkingTimeDTOList == null || epasPersonWorkingTimeDTOList.isEmpty()) {
|
if (epasPersonWorkingTimeDTOList == null || epasPersonWorkingTimeDTOList.isEmpty()) {
|
||||||
logger.error("PersonWorkingTimeDTOList not found");
|
logger.error("PersonWorkingTimeDTOList not found");
|
||||||
|
@ -1632,7 +1632,7 @@ public class SyncService {
|
||||||
|
|
||||||
logger.info("Reference: {}-{}", year, month);
|
logger.info("Reference: {}-{}", year, month);
|
||||||
|
|
||||||
EPASValidates epasValidates = epasValidatesService.getValidatesByOfficeCodeId(ISTI_OFFICE_CODEID, year, month);
|
EPASValidates epasValidates = epasValidatesService.getValidatesByOfficeCodeId(OfficeConstants.ISTI_OFFICE_CODEID, year, month);
|
||||||
// if (!epasValidates.getAllCertificationsValidated()) {
|
// if (!epasValidates.getAllCertificationsValidated()) {
|
||||||
// logger.info("No month closed on EPAS: {}", nextMonthToSent);
|
// logger.info("No month closed on EPAS: {}", nextMonthToSent);
|
||||||
// return;
|
// return;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#H2 Server Properties
|
#H2 Server Properties
|
||||||
#Mon Nov 14 15:08:07 CET 2022
|
#Mon Feb 10 12:24:19 CET 2025
|
||||||
0=JHipster H2 (Disk)|org.h2.Driver|jdbc\:h2\:file\:./target/h2db/db/epasmed|epasmed
|
0=JHipster H2 (Disk)|org.h2.Driver|jdbc\:h2\:file\:./target/h2db/db/epasmed|epasmed
|
||||||
webAllowOthers=true
|
webAllowOthers=true
|
||||||
webPort=8082
|
webPort=8082
|
||||||
|
|
|
@ -38,11 +38,6 @@ public class EPASAbsenceTypesResourceIT {
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(getClass());
|
private final Logger logger = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
// private static final String OFFICE_DEFAULT_ID = "1";
|
|
||||||
// private static final String OFFICE_DEFAULT_NAME = "ISTI - Pisa";
|
|
||||||
// private static final String OFFICE_DEFAULT_CODE = "074000";
|
|
||||||
// private static final String OFFICE_DEFAULT_CODEID = "225200";
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MockMvc restEPASAbsenceTypesMockMvc;
|
private MockMvc restEPASAbsenceTypesMockMvc;
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
import it.cnr.isti.epasmed.EpasmedApp;
|
import it.cnr.isti.epasmed.EpasmedApp;
|
||||||
|
import it.cnr.isti.epasmed.OfficeConstants;
|
||||||
import it.cnr.isti.epasmed.epas.dto.EPASAffiliationsDTO;
|
import it.cnr.isti.epasmed.epas.dto.EPASAffiliationsDTO;
|
||||||
import it.cnr.isti.epasmed.epas.mapper.EPASAffiliationsMapper;
|
import it.cnr.isti.epasmed.epas.mapper.EPASAffiliationsMapper;
|
||||||
import it.cnr.isti.epasmed.epas.model.EPASAffiliations;
|
import it.cnr.isti.epasmed.epas.model.EPASAffiliations;
|
||||||
|
@ -52,10 +53,7 @@ public class EPASAffiliationsResourceIT {
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
private static final String OFFICE_DEFAULT_ID = "1";
|
private static final String PERSON_DEFAULT_FISCAL_CODE = "PNCGCR75S04L103G";
|
||||||
//private static final String OFFICE_DEFAULT_NAME = "ISTI - Pisa";
|
|
||||||
//private static final String OFFICE_DEFAULT_CODE = "074000";
|
|
||||||
//private static final String OFFICE_DEFAULT_CODEID = "225200";
|
|
||||||
|
|
||||||
private static final String AFFILIATION_DEFAULT_ID = "1";
|
private static final String AFFILIATION_DEFAULT_ID = "1";
|
||||||
private static final String AFFILIATION_DEFAULT_BEGINDATE = "2021-01-01";
|
private static final String AFFILIATION_DEFAULT_BEGINDATE = "2021-01-01";
|
||||||
|
@ -107,23 +105,23 @@ public class EPASAffiliationsResourceIT {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAffiliationByGroup() throws Exception {
|
public void getAffiliationByGroup() throws Exception {
|
||||||
restEPASAffiliationsMockMvc.perform(get("/api/epas/affiliations/byGroup?id=" + 23)).andExpect(status().isOk());
|
restEPASAffiliationsMockMvc.perform(get("/api/epas/affiliations/byGroup?id=" + 385)).andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAffiliationByPersonId() throws Exception {
|
public void getAffiliationByPersonId() throws Exception {
|
||||||
restEPASAffiliationsMockMvc.perform(get("/api/epas/affiliations/byPerson?id=" + 43)).andExpect(status().isOk());
|
restEPASAffiliationsMockMvc.perform(get("/api/epas/affiliations/byPerson?id=" + 11694)).andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAffiliationByPersonFiscalcode() throws Exception {
|
public void getAffiliationByPersonFiscalcode() throws Exception {
|
||||||
restEPASAffiliationsMockMvc.perform(get("/api/epas/affiliations/byPerson?fiscalCode=DZZPRZ79S23B832W"))
|
restEPASAffiliationsMockMvc.perform(get("/api/epas/affiliations/byPerson?fiscalCode="+PERSON_DEFAULT_FISCAL_CODE))
|
||||||
.andExpect(status().isOk());
|
.andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAffiliationList() throws Exception {
|
public void getAffiliationList() throws Exception {
|
||||||
restEPASAffiliationsMockMvc.perform(get("/api/epas/affiliations?officeId=" + OFFICE_DEFAULT_ID))
|
restEPASAffiliationsMockMvc.perform(get("/api/epas/affiliations?officeId=" + OfficeConstants.ISTI_OFFICE_ID))
|
||||||
.andExpect(status().isOk());
|
.andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +208,7 @@ public class EPASAffiliationsResourceIT {
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<EPASGroups> retrieveEPASGroups() throws Exception {
|
private List<EPASGroups> retrieveEPASGroups() throws Exception {
|
||||||
MvcResult result = restEPASAffiliationsMockMvc.perform(get("/api/epas/groups?officeId=" + OFFICE_DEFAULT_ID))
|
MvcResult result = restEPASAffiliationsMockMvc.perform(get("/api/epas/groups?officeId=" + OfficeConstants.ISTI_OFFICE_ID))
|
||||||
.andExpect(status().isOk()).andReturn();
|
.andExpect(status().isOk()).andReturn();
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
List<EPASGroups> epasGroups = mapper.readValue(result.getResponse().getContentAsString(),
|
List<EPASGroups> epasGroups = mapper.readValue(result.getResponse().getContentAsString(),
|
||||||
|
|
|
@ -16,6 +16,7 @@ import org.springframework.test.context.junit.jupiter.EnabledIf;
|
||||||
import org.springframework.test.web.servlet.MockMvc;
|
import org.springframework.test.web.servlet.MockMvc;
|
||||||
|
|
||||||
import it.cnr.isti.epasmed.EpasmedApp;
|
import it.cnr.isti.epasmed.EpasmedApp;
|
||||||
|
import it.cnr.isti.epasmed.OfficeConstants;
|
||||||
import it.cnr.isti.epasmed.security.AuthoritiesConstants;
|
import it.cnr.isti.epasmed.security.AuthoritiesConstants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,18 +30,14 @@ public class EPASCertificationsResourceIT {
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
// private static final String OFFICE_DEFAULT_ID = "1";
|
|
||||||
// private static final String OFFICE_DEFAULT_NAME = "ISTI - Pisa";
|
|
||||||
// private static final String OFFICE_DEFAULT_CODE = "074000";
|
|
||||||
private static final String OFFICE_DEFAULT_CODEID = "225200";
|
|
||||||
|
|
||||||
private static final String PERSON_DEFAULT_ID = "113";
|
private static final String PERSON_DEFAULT_ID = "113";
|
||||||
//private static final String PERSON_DEFAULT_NAME = "Giuseppe";
|
|
||||||
//private static final String PERSON_DEFAULT_SURNAME = "Amato";
|
|
||||||
private static final String PERSON_DEFAULT_FISCAL_CODE = "MTAGPP68D15D976W";
|
private static final String PERSON_DEFAULT_FISCAL_CODE = "MTAGPP68D15D976W";
|
||||||
private static final String PERSON_DEFAULT_EMAIL = "giuseppe.amato@cnr.it";
|
private static final String PERSON_DEFAULT_EMAIL = "giuseppe.amato@cnr.it";
|
||||||
//private static final String PERSON_DEFAULT_QUALIFICATION = "2";
|
//private static final String PERSON_DEFAULT_QUALIFICATION = "2";
|
||||||
|
|
||||||
|
private static final String YEAR_DEFAULT = "2025";
|
||||||
|
private static final String MONTH_DEFAULT = "1";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MockMvc restEPASCertificationsMockMvc;
|
private MockMvc restEPASCertificationsMockMvc;
|
||||||
|
@ -59,7 +56,7 @@ public class EPASCertificationsResourceIT {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getEPASCertificationsByPersonId() throws Exception {
|
public void getEPASCertificationsByPersonId() throws Exception {
|
||||||
restEPASCertificationsMockMvc.perform(get("/api/epas/certifications/getMonthSituation?id=" + PERSON_DEFAULT_ID + "&year=2021&month=11"))
|
restEPASCertificationsMockMvc.perform(get("/api/epas/certifications/getMonthSituation?id=" + PERSON_DEFAULT_ID + "&year="+YEAR_DEFAULT+"&month="+MONTH_DEFAULT))
|
||||||
.andExpect(status().isOk());
|
.andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,21 +64,21 @@ public class EPASCertificationsResourceIT {
|
||||||
public void getEPASCertificationsByPersonFiscalcode() throws Exception {
|
public void getEPASCertificationsByPersonFiscalcode() throws Exception {
|
||||||
restEPASCertificationsMockMvc
|
restEPASCertificationsMockMvc
|
||||||
.perform(
|
.perform(
|
||||||
get("/api/epas/certifications/getMonthSituation?fiscalCode=" + PERSON_DEFAULT_FISCAL_CODE + "&year=2021&month=11"))
|
get("/api/epas/certifications/getMonthSituation?fiscalCode=" + PERSON_DEFAULT_FISCAL_CODE + "&year="+YEAR_DEFAULT+"&month="+MONTH_DEFAULT))
|
||||||
.andExpect(status().isOk());
|
.andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getEPASCertificationsByPersonEmail() throws Exception {
|
public void getEPASCertificationsByPersonEmail() throws Exception {
|
||||||
restEPASCertificationsMockMvc
|
restEPASCertificationsMockMvc
|
||||||
.perform(get("/api/epas/certifications/getMonthSituation?email=" + PERSON_DEFAULT_EMAIL + "&year=2021&month=11"))
|
.perform(get("/api/epas/certifications/getMonthSituation?email=" + PERSON_DEFAULT_EMAIL + "&year="+YEAR_DEFAULT+"&month="+MONTH_DEFAULT))
|
||||||
.andExpect(status().isOk());
|
.andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getEPASCertificationsByOfficeCodeId() throws Exception {
|
public void getEPASCertificationsByOfficeCodeId() throws Exception {
|
||||||
restEPASCertificationsMockMvc
|
restEPASCertificationsMockMvc
|
||||||
.perform(get("/api/epas/certifications/getMonthSituationByOffice?officeCodeId=" + OFFICE_DEFAULT_CODEID + "&year=2021&month=10"))
|
.perform(get("/api/epas/certifications/getMonthSituationByOffice?officeCodeId=" + OfficeConstants.ISTI_OFFICE_CODEID + "&year="+YEAR_DEFAULT+"&month="+MONTH_DEFAULT))
|
||||||
.andExpect(status().isOk());
|
.andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
import it.cnr.isti.epasmed.EpasmedApp;
|
import it.cnr.isti.epasmed.EpasmedApp;
|
||||||
|
import it.cnr.isti.epasmed.OfficeConstants;
|
||||||
import it.cnr.isti.epasmed.epas.dto.EPASChildrenDTO;
|
import it.cnr.isti.epasmed.epas.dto.EPASChildrenDTO;
|
||||||
import it.cnr.isti.epasmed.epas.mapper.EPASChildrenMapper;
|
import it.cnr.isti.epasmed.epas.mapper.EPASChildrenMapper;
|
||||||
import it.cnr.isti.epasmed.epas.model.EPASChildren;
|
import it.cnr.isti.epasmed.epas.model.EPASChildren;
|
||||||
|
@ -52,16 +53,10 @@ public class EPASChildrenResourceIT {
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
private static final String OFFICE_DEFAULT_ID = "1";
|
|
||||||
private static final String OFFICE_DEFAULT_NAME = "ISTI - Pisa";
|
|
||||||
private static final String OFFICE_DEFAULT_CODE = "074000";
|
|
||||||
private static final String OFFICE_DEFAULT_CODEID = "225200";
|
|
||||||
|
|
||||||
private static final String PERSON_DEFAULT_ID = "113";
|
private static final String PERSON_DEFAULT_ID = "113";
|
||||||
// private static final String PERSON_DEFAULT_NAME = "Giuseppe";
|
private static final String PERSON_DEFAULT_FISCAL_CODE = "PNCGCR75S04L103G";
|
||||||
// private static final String PERSON_DEFAULT_SURNAME = "Amato";
|
private static final String PERSON_DEFAULT_EMAIL = "giancarlo.panichi@cnr.it";
|
||||||
private static final String PERSON_DEFAULT_FISCAL_CODE = "MTAGPP68D15D976W";
|
|
||||||
private static final String PERSON_DEFAULT_EMAIL = "giuseppe.amato@cnr.it";
|
|
||||||
// private static final String PERSON_DEFAULT_QUALIFICATION = "2";
|
// private static final String PERSON_DEFAULT_QUALIFICATION = "2";
|
||||||
|
|
||||||
private static final String CHILDREN_DEFAULT_ID = "xxx";
|
private static final String CHILDREN_DEFAULT_ID = "xxx";
|
||||||
|
@ -85,10 +80,10 @@ public class EPASChildrenResourceIT {
|
||||||
|
|
||||||
public static EPASOffice createOffice() {
|
public static EPASOffice createOffice() {
|
||||||
EPASOffice epasOffice = new EPASOffice();
|
EPASOffice epasOffice = new EPASOffice();
|
||||||
epasOffice.setId(OFFICE_DEFAULT_ID);
|
epasOffice.setId(OfficeConstants.ISTI_OFFICE_ID);
|
||||||
epasOffice.setName(OFFICE_DEFAULT_NAME);
|
epasOffice.setName(OfficeConstants.ISTI_OFFICE_NAME);
|
||||||
epasOffice.setCode(OFFICE_DEFAULT_CODE);
|
epasOffice.setCode(OfficeConstants.ISTI_OFFICE_CODE);
|
||||||
epasOffice.setCodeId(OFFICE_DEFAULT_CODEID);
|
epasOffice.setCodeId(OfficeConstants.ISTI_OFFICE_CODEID);
|
||||||
return epasOffice;
|
return epasOffice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +156,7 @@ public class EPASChildrenResourceIT {
|
||||||
|
|
||||||
List<EPASPersons> epasPersons = null;
|
List<EPASPersons> epasPersons = null;
|
||||||
try {
|
try {
|
||||||
MvcResult result = restEPASChildrenMockMvc.perform(get("/api/epas/persons?officeId=" + OFFICE_DEFAULT_ID))
|
MvcResult result = restEPASChildrenMockMvc.perform(get("/api/epas/persons?officeId=" + OfficeConstants.ISTI_OFFICE_ID))
|
||||||
.andExpect(status().isOk()).andReturn();
|
.andExpect(status().isOk()).andReturn();
|
||||||
|
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
|
|
@ -37,6 +37,7 @@ import com.fasterxml.jackson.databind.JsonMappingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
import it.cnr.isti.epasmed.EpasmedApp;
|
import it.cnr.isti.epasmed.EpasmedApp;
|
||||||
|
import it.cnr.isti.epasmed.OfficeConstants;
|
||||||
import it.cnr.isti.epasmed.epas.dto.EPASContractsDTO;
|
import it.cnr.isti.epasmed.epas.dto.EPASContractsDTO;
|
||||||
import it.cnr.isti.epasmed.epas.mapper.EPASContractsMapper;
|
import it.cnr.isti.epasmed.epas.mapper.EPASContractsMapper;
|
||||||
import it.cnr.isti.epasmed.epas.model.EPASContracts;
|
import it.cnr.isti.epasmed.epas.model.EPASContracts;
|
||||||
|
@ -55,10 +56,6 @@ public class EPASContractsResourceIT {
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(getClass());
|
private final Logger logger = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
private static final String OFFICE_DEFAULT_ID = "1";
|
|
||||||
//private static final String OFFICE_DEFAULT_CODEID = "225200";
|
|
||||||
|
|
||||||
|
|
||||||
private static final String PERSON_DEFAULT_ID = "1";
|
private static final String PERSON_DEFAULT_ID = "1";
|
||||||
private static final String PERSON_DEFAULT_NAME = "Giancarlo";
|
private static final String PERSON_DEFAULT_NAME = "Giancarlo";
|
||||||
private static final String PERSON_DEFAULT_SURNAME = "Panichi";
|
private static final String PERSON_DEFAULT_SURNAME = "Panichi";
|
||||||
|
@ -157,7 +154,7 @@ public class EPASContractsResourceIT {
|
||||||
@Test
|
@Test
|
||||||
public void getContractMap() throws Exception {
|
public void getContractMap() throws Exception {
|
||||||
MvcResult result = restEPASContractsMockMvc
|
MvcResult result = restEPASContractsMockMvc
|
||||||
.perform(get("/api/epas/contracts/map?officeId=" + OFFICE_DEFAULT_ID))
|
.perform(get("/api/epas/contracts/map?officeId=" + OfficeConstants.ISTI_OFFICE_ID))
|
||||||
.andExpect(status().isOk()).andReturn();
|
.andExpect(status().isOk()).andReturn();
|
||||||
|
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
|
|
@ -28,6 +28,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
import it.cnr.isti.epasmed.EpasmedApp;
|
import it.cnr.isti.epasmed.EpasmedApp;
|
||||||
|
import it.cnr.isti.epasmed.OfficeConstants;
|
||||||
import it.cnr.isti.epasmed.epas.dto.EPASGroupsDTO;
|
import it.cnr.isti.epasmed.epas.dto.EPASGroupsDTO;
|
||||||
import it.cnr.isti.epasmed.epas.mapper.EPASGroupsMapper;
|
import it.cnr.isti.epasmed.epas.mapper.EPASGroupsMapper;
|
||||||
import it.cnr.isti.epasmed.epas.model.EPASGroups;
|
import it.cnr.isti.epasmed.epas.model.EPASGroups;
|
||||||
|
@ -47,10 +48,7 @@ public class EPASGroupsResourceIT {
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
private static final String OFFICE_DEFAULT_ID = "1";
|
|
||||||
private static final String OFFICE_DEFAULT_NAME = "ISTI - Pisa";
|
|
||||||
private static final String OFFICE_DEFAULT_CODE = "074000";
|
|
||||||
private static final String OFFICE_DEFAULT_CODEID = "225200";
|
|
||||||
|
|
||||||
private static final String MANAGER_DEFAULT_ID = "1";
|
private static final String MANAGER_DEFAULT_ID = "1";
|
||||||
private static final String MANAGER_DEFAULT_FULLNAME = "Giancarlo Panichi";
|
private static final String MANAGER_DEFAULT_FULLNAME = "Giancarlo Panichi";
|
||||||
|
@ -113,10 +111,10 @@ public class EPASGroupsResourceIT {
|
||||||
|
|
||||||
public static EPASOffice createOffice() {
|
public static EPASOffice createOffice() {
|
||||||
EPASOffice epasOffice = new EPASOffice();
|
EPASOffice epasOffice = new EPASOffice();
|
||||||
epasOffice.setId(OFFICE_DEFAULT_ID);
|
epasOffice.setId(OfficeConstants.ISTI_OFFICE_ID);
|
||||||
epasOffice.setName(OFFICE_DEFAULT_NAME);
|
epasOffice.setName(OfficeConstants.ISTI_OFFICE_NAME);
|
||||||
epasOffice.setCode(OFFICE_DEFAULT_CODE);
|
epasOffice.setCode(OfficeConstants.ISTI_OFFICE_CODE);
|
||||||
epasOffice.setCodeId(OFFICE_DEFAULT_CODEID);
|
epasOffice.setCodeId(OfficeConstants.ISTI_OFFICE_CODEID);
|
||||||
return epasOffice;
|
return epasOffice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +197,7 @@ public class EPASGroupsResourceIT {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getGroupList() throws Exception {
|
public void getGroupList() throws Exception {
|
||||||
restEPASGroupsMockMvc.perform(get("/api/epas/groups?officeId=" + OFFICE_DEFAULT_ID)).andExpect(status().isOk());
|
restEPASGroupsMockMvc.perform(get("/api/epas/groups?officeId=" + OfficeConstants.ISTI_OFFICE_ID)).andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -222,7 +220,7 @@ public class EPASGroupsResourceIT {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void istiUpdateGroups() throws Exception {
|
public void istiUpdateGroups() throws Exception {
|
||||||
MvcResult result = restEPASGroupsMockMvc.perform(get("/api/epas/groups?officeId=" + OFFICE_DEFAULT_ID))
|
MvcResult result = restEPASGroupsMockMvc.perform(get("/api/epas/groups?officeId=" + OfficeConstants.ISTI_OFFICE_ID))
|
||||||
.andExpect(status().isOk()).andReturn();
|
.andExpect(status().isOk()).andReturn();
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
List<EPASGroups> epasG = mapper.readValue(result.getResponse().getContentAsString(),
|
List<EPASGroups> epasG = mapper.readValue(result.getResponse().getContentAsString(),
|
||||||
|
@ -263,7 +261,7 @@ public class EPASGroupsResourceIT {
|
||||||
@Test
|
@Test
|
||||||
public void getGroupByExternalId() throws Exception{
|
public void getGroupByExternalId() throws Exception{
|
||||||
String externalId="29";
|
String externalId="29";
|
||||||
MvcResult mvcResult=restEPASGroupsMockMvc.perform(get("/api/epas/groups?officeId=" + OFFICE_DEFAULT_ID)).andExpect(status().isOk()).andReturn();
|
MvcResult mvcResult=restEPASGroupsMockMvc.perform(get("/api/epas/groups?officeId=" + OfficeConstants.ISTI_OFFICE_ID)).andExpect(status().isOk()).andReturn();
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
|
||||||
List<EPASGroups> epasGroups = mapper.readValue(mvcResult.getResponse().getContentAsString(),
|
List<EPASGroups> epasGroups = mapper.readValue(mvcResult.getResponse().getContentAsString(),
|
||||||
|
|
|
@ -16,6 +16,7 @@ import org.springframework.test.context.junit.jupiter.EnabledIf;
|
||||||
import org.springframework.test.web.servlet.MockMvc;
|
import org.springframework.test.web.servlet.MockMvc;
|
||||||
|
|
||||||
import it.cnr.isti.epasmed.EpasmedApp;
|
import it.cnr.isti.epasmed.EpasmedApp;
|
||||||
|
import it.cnr.isti.epasmed.OfficeConstants;
|
||||||
import it.cnr.isti.epasmed.security.AuthoritiesConstants;
|
import it.cnr.isti.epasmed.security.AuthoritiesConstants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,18 +30,14 @@ public class EPASLeavesResourceIT {
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
private static final String OFFICE_DEFAULT_ID = "1";
|
private static final String YEAR_DEFAULT = "2025";
|
||||||
// private static final String OFFICE_DEFAULT_NAME = "ISTI - Pisa";
|
|
||||||
// private static final String OFFICE_DEFAULT_CODE = "074000";
|
|
||||||
// private static final String OFFICE_DEFAULT_CODEID = "225200";
|
|
||||||
private static final String YEAR_DEFAULT = "2022";
|
|
||||||
private static final String INCLUDEDETAILS_DEFAULT = "false";
|
private static final String INCLUDEDETAILS_DEFAULT = "false";
|
||||||
|
|
||||||
private static final String PERSON_DEFAULT_ID = "1";
|
private static final String PERSON_DEFAULT_ID = "1";
|
||||||
// private static final String PERSON_DEFAULT_NAME = "Giulio";
|
// private static final String PERSON_DEFAULT_NAME = "Maria";
|
||||||
// private static final String PERSON_DEFAULT_SURNAME = "Mori";
|
// private static final String PERSON_DEFAULT_SURNAME = "Picchi";
|
||||||
private static final String PERSON_DEFAULT_FISCAL_CODE = "MROGLI68H29E625F";
|
private static final String PERSON_DEFAULT_FISCAL_CODE = "PCCMRA63M50G702W";
|
||||||
private static final String PERSON_DEFAULT_EMAIL = "giulio.mori@cnr.it";
|
private static final String PERSON_DEFAULT_EMAIL = "maria.picchi@cnr.it";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MockMvc restEPASLeavesMockMvc;
|
private MockMvc restEPASLeavesMockMvc;
|
||||||
|
@ -77,7 +74,7 @@ public class EPASLeavesResourceIT {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getEPASLeavesByOfficeId() throws Exception {
|
public void getEPASLeavesByOfficeId() throws Exception {
|
||||||
restEPASLeavesMockMvc.perform(get("/api/epas/leaves/byOfficeAndYear?officeId=" + OFFICE_DEFAULT_ID + "&year="
|
restEPASLeavesMockMvc.perform(get("/api/epas/leaves/byOfficeAndYear?officeId=" + OfficeConstants.ISTI_OFFICE_ID + "&year="
|
||||||
+ YEAR_DEFAULT + "&includeDetails=" + INCLUDEDETAILS_DEFAULT)).andExpect(status().isOk());
|
+ YEAR_DEFAULT + "&includeDetails=" + INCLUDEDETAILS_DEFAULT)).andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ import org.springframework.test.context.junit.jupiter.EnabledIf;
|
||||||
import org.springframework.test.web.servlet.MockMvc;
|
import org.springframework.test.web.servlet.MockMvc;
|
||||||
|
|
||||||
import it.cnr.isti.epasmed.EpasmedApp;
|
import it.cnr.isti.epasmed.EpasmedApp;
|
||||||
|
import it.cnr.isti.epasmed.OfficeConstants;
|
||||||
import it.cnr.isti.epasmed.security.AuthoritiesConstants;
|
import it.cnr.isti.epasmed.security.AuthoritiesConstants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,20 +30,14 @@ public class EPASOffSiteWorksResourceIT {
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
//private static final String OFFICE_DEFAULT_ID = "1";
|
|
||||||
//private static final String OFFICE_DEFAULT_NAME = "ISTI - Pisa";
|
|
||||||
//private static final String OFFICE_DEFAULT_CODE = "074000";
|
|
||||||
private static final String OFFICE_DEFAULT_CODEID = "225200";
|
|
||||||
|
|
||||||
private static final String PERSON_DEFAULT_ID = "113";
|
private static final String PERSON_DEFAULT_ID = "113";
|
||||||
//private static final String PERSON_DEFAULT_NAME = "Giuseppe";
|
private static final String PERSON_DEFAULT_FISCAL_CODE = "RMNVTR73C05H224X";
|
||||||
//private static final String PERSON_DEFAULT_SURNAME = "Amato";
|
private static final String PERSON_DEFAULT_EMAIL = "vittorioenricocarlo.romano@cnr.it";
|
||||||
private static final String PERSON_DEFAULT_FISCAL_CODE = "MTAGPP68D15D976W";
|
|
||||||
|
|
||||||
|
|
||||||
private static final String PERSON_DEFAULT_EMAIL = "giuseppe.amato@cnr.it";
|
|
||||||
//private static final String PERSON_DEFAULT_QUALIFICATION = "2";
|
//private static final String PERSON_DEFAULT_QUALIFICATION = "2";
|
||||||
|
|
||||||
|
private static final String YEAR_DEFAULT = "2025";
|
||||||
|
private static final String MONTH_DEFAULT = "1";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MockMvc restEPASTimeCardsMockMvc;
|
private MockMvc restEPASTimeCardsMockMvc;
|
||||||
|
|
||||||
|
@ -59,22 +54,22 @@ public class EPASOffSiteWorksResourceIT {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getOffSiteWorksByPersonId() throws Exception {
|
public void getOffSiteWorksByPersonId() throws Exception {
|
||||||
restEPASTimeCardsMockMvc.perform(get("/api/epas/offsiteworks/byPerson?id="+PERSON_DEFAULT_ID+"&year=2022&month=6")).andExpect(status().isOk());
|
restEPASTimeCardsMockMvc.perform(get("/api/epas/offsiteworks/byPerson?id="+PERSON_DEFAULT_ID+"&year="+YEAR_DEFAULT+"&month="+MONTH_DEFAULT)).andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getOffSiteWorksByPersonFiscalCode() throws Exception {
|
public void getOffSiteWorksByPersonFiscalCode() throws Exception {
|
||||||
restEPASTimeCardsMockMvc.perform(get("/api/epas/offsiteworks/byPerson?fiscalCode="+PERSON_DEFAULT_FISCAL_CODE+"&year=2022&month=6")).andExpect(status().isOk());
|
restEPASTimeCardsMockMvc.perform(get("/api/epas/offsiteworks/byPerson?fiscalCode="+PERSON_DEFAULT_FISCAL_CODE+"&year="+YEAR_DEFAULT+"&month="+MONTH_DEFAULT)).andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getOffSiteWorksByPersonEmail() throws Exception {
|
public void getOffSiteWorksByPersonEmail() throws Exception {
|
||||||
restEPASTimeCardsMockMvc.perform(get("/api/epas/offsiteworks/byPerson?email="+PERSON_DEFAULT_EMAIL+"&year=2022&month=6")).andExpect(status().isOk());
|
restEPASTimeCardsMockMvc.perform(get("/api/epas/offsiteworks/byPerson?email="+PERSON_DEFAULT_EMAIL+"&year="+YEAR_DEFAULT+"&month="+MONTH_DEFAULT)).andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getOffSiteWorksByOfficeCodeId() throws Exception {
|
public void getOffSiteWorksByOfficeCodeId() throws Exception {
|
||||||
restEPASTimeCardsMockMvc.perform(get("/api/epas/offsiteworks/byOffice?codeId="+OFFICE_DEFAULT_CODEID+"&year=2022&month=6")).andExpect(status().isOk());
|
restEPASTimeCardsMockMvc.perform(get("/api/epas/offsiteworks/byOffice?codeId="+OfficeConstants.ISTI_OFFICE_CODEID+"&year="+YEAR_DEFAULT+"&month="+MONTH_DEFAULT)).andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
import it.cnr.isti.epasmed.EpasmedApp;
|
import it.cnr.isti.epasmed.EpasmedApp;
|
||||||
|
import it.cnr.isti.epasmed.OfficeConstants;
|
||||||
import it.cnr.isti.epasmed.epas.dto.EPASPersonWorkingTimeDTO;
|
import it.cnr.isti.epasmed.epas.dto.EPASPersonWorkingTimeDTO;
|
||||||
import it.cnr.isti.epasmed.security.AuthoritiesConstants;
|
import it.cnr.isti.epasmed.security.AuthoritiesConstants;
|
||||||
|
|
||||||
|
@ -37,16 +38,11 @@ public class EPASPersonWorkingTimeIT {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(EPASPersonWorkingTimeIT.class);
|
private static final Logger logger = LoggerFactory.getLogger(EPASPersonWorkingTimeIT.class);
|
||||||
|
|
||||||
private static final String OFFICE_DEFAULT_ID = "1";
|
|
||||||
// private static final String OFFICE_DEFAULT_NAME = "ISTI - Pisa";
|
|
||||||
// private static final String OFFICE_DEFAULT_CODE = "074000";
|
|
||||||
// private static final String OFFICE_DEFAULT_CODEID = "225200";
|
|
||||||
|
|
||||||
private static final String PERSON_DEFAULT_ID = "78";
|
private static final String PERSON_DEFAULT_ID = "78";
|
||||||
//private static final String PERSON_DEFAULT_FISCAL_CODE = "MROGLI68H29E625F";
|
//private static final String PERSON_DEFAULT_FISCAL_CODE = "PNCGCR75S04L103G";
|
||||||
private static final String PERSON_DEFAULT_FISCAL_CODE = "PNCGCR75S04L103G";
|
|
||||||
//private static final String PERSON_DEFAULT_FISCAL_CODE = "MLSDNL59T56E281S";
|
//private static final String PERSON_DEFAULT_FISCAL_CODE = "MLSDNL59T56E281S";
|
||||||
//private static final String PERSON_DEFAULT_FISCAL_CODE = "PCCMRA63M50G702W";
|
private static final String PERSON_DEFAULT_FISCAL_CODE = "PCCMRA63M50G702W";
|
||||||
//private static final String PERSON_DEFAULT_FISCAL_CODE = "LMBGNN59T09G702K";
|
//private static final String PERSON_DEFAULT_FISCAL_CODE = "LMBGNN59T09G702K";
|
||||||
//private static final String PERSON_DEFAULT_FISCAL_CODE = "MNGPLA70T22D612X";
|
//private static final String PERSON_DEFAULT_FISCAL_CODE = "MNGPLA70T22D612X";
|
||||||
|
|
||||||
|
@ -94,7 +90,7 @@ public class EPASPersonWorkingTimeIT {
|
||||||
@Test
|
@Test
|
||||||
public void getPersonWorkingTimeList() throws Exception {
|
public void getPersonWorkingTimeList() throws Exception {
|
||||||
MvcResult result = restEPASPersonWorkingTimeMockMvc
|
MvcResult result = restEPASPersonWorkingTimeMockMvc
|
||||||
.perform(get("/api/epas/personworkingtime/list?officeId=" + OFFICE_DEFAULT_ID)).andExpect(status().isOk())
|
.perform(get("/api/epas/personworkingtime/list?officeId=" + OfficeConstants.ISTI_OFFICE_ID)).andExpect(status().isOk())
|
||||||
.andReturn();
|
.andReturn();
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
List<EPASPersonWorkingTimeDTO> epasWTTList = mapper.readValue(result.getResponse().getContentAsString(),
|
List<EPASPersonWorkingTimeDTO> epasWTTList = mapper.readValue(result.getResponse().getContentAsString(),
|
||||||
|
|
|
@ -33,6 +33,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
import it.cnr.isti.epasmed.EpasmedApp;
|
import it.cnr.isti.epasmed.EpasmedApp;
|
||||||
|
import it.cnr.isti.epasmed.OfficeConstants;
|
||||||
import it.cnr.isti.epasmed.epas.dto.EPASPersonsDTO;
|
import it.cnr.isti.epasmed.epas.dto.EPASPersonsDTO;
|
||||||
import it.cnr.isti.epasmed.epas.mapper.EPASPersonsMapper;
|
import it.cnr.isti.epasmed.epas.mapper.EPASPersonsMapper;
|
||||||
import it.cnr.isti.epasmed.epas.model.EPASOffice;
|
import it.cnr.isti.epasmed.epas.model.EPASOffice;
|
||||||
|
@ -51,15 +52,11 @@ public class EPASPersonsResourceIT {
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
private static final String OFFICE_DEFAULT_ID = "1";
|
|
||||||
private static final String OFFICE_DEFAULT_NAME = "ISTI - Pisa";
|
private static final String PERSON_DEFAULT_ID = "11694";
|
||||||
private static final String OFFICE_DEFAULT_CODE = "074000";
|
|
||||||
private static final String OFFICE_DEFAULT_CODEID = "225200";
|
|
||||||
|
|
||||||
private static final String PERSON_DEFAULT_ID = "113";
|
|
||||||
private static final String PERSON_DEFAULT_NAME = "nometest1";
|
private static final String PERSON_DEFAULT_NAME = "nometest1";
|
||||||
private static final String PERSON_DEFAULT_SURNAME = "cognometest1";
|
private static final String PERSON_DEFAULT_SURNAME = "cognometest1";
|
||||||
private static final String PERSON_DEFAULT_FISCAL_CODE = "codicefiscaletes";
|
private static final String PERSON_DEFAULT_FISCAL_CODE = "codicefiscaletest";
|
||||||
private static final String PERSON_DEFAULT_EMAIL = "nometest1.cognometest1@test.it";
|
private static final String PERSON_DEFAULT_EMAIL = "nometest1.cognometest1@test.it";
|
||||||
private static final String PERSON_DEFAULT_QUALIFICATION = "3";
|
private static final String PERSON_DEFAULT_QUALIFICATION = "3";
|
||||||
|
|
||||||
|
@ -97,10 +94,10 @@ public class EPASPersonsResourceIT {
|
||||||
|
|
||||||
public static EPASOffice createOffice() {
|
public static EPASOffice createOffice() {
|
||||||
EPASOffice epasOffice = new EPASOffice();
|
EPASOffice epasOffice = new EPASOffice();
|
||||||
epasOffice.setId(OFFICE_DEFAULT_ID);
|
epasOffice.setId(OfficeConstants.ISTI_OFFICE_ID);
|
||||||
epasOffice.setName(OFFICE_DEFAULT_NAME);
|
epasOffice.setName(OfficeConstants.ISTI_OFFICE_NAME);
|
||||||
epasOffice.setCode(OFFICE_DEFAULT_CODE);
|
epasOffice.setCode(OfficeConstants.ISTI_OFFICE_CODE);
|
||||||
epasOffice.setCodeId(OFFICE_DEFAULT_CODEID);
|
epasOffice.setCodeId(OfficeConstants.ISTI_OFFICE_CODEID);
|
||||||
return epasOffice;
|
return epasOffice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +123,7 @@ public class EPASPersonsResourceIT {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getPersonList() throws Exception {
|
public void getPersonList() throws Exception {
|
||||||
restEPASPersonsMockMvc.perform(get("/api/epas/persons?officeId=" + OFFICE_DEFAULT_ID))
|
restEPASPersonsMockMvc.perform(get("/api/epas/persons?officeId=" + OfficeConstants.ISTI_OFFICE_ID))
|
||||||
.andExpect(status().isOk());
|
.andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +152,7 @@ public class EPASPersonsResourceIT {
|
||||||
|
|
||||||
List<EPASPersons> epasPersons = null;
|
List<EPASPersons> epasPersons = null;
|
||||||
try {
|
try {
|
||||||
MvcResult result = restEPASPersonsMockMvc.perform(get("/api/epas/persons?officeId=" + OFFICE_DEFAULT_ID))
|
MvcResult result = restEPASPersonsMockMvc.perform(get("/api/epas/persons?officeId=" + OfficeConstants.ISTI_OFFICE_ID))
|
||||||
.andExpect(status().isOk()).andReturn();
|
.andExpect(status().isOk()).andReturn();
|
||||||
|
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
|
|
@ -43,10 +43,6 @@ public class EPASStampingsResourceIT {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(EPASStampingsResourceIT.class);
|
private static final Logger logger = LoggerFactory.getLogger(EPASStampingsResourceIT.class);
|
||||||
|
|
||||||
// private static final String OFFICE_DEFAULT_ID = "1";
|
|
||||||
// private static final String OFFICE_DEFAULT_NAME = "ISTI - Pisa";
|
|
||||||
// private static final String OFFICE_DEFAULT_CODE = "074000";
|
|
||||||
// private static final String OFFICE_DEFAULT_CODEID = "225200";
|
|
||||||
|
|
||||||
private static final String STAMPING_DEFAULT_WAYTYPE = "in";
|
private static final String STAMPING_DEFAULT_WAYTYPE = "in";
|
||||||
private static final String STAMPING_DEFAULT_REASONTYPE = null;
|
private static final String STAMPING_DEFAULT_REASONTYPE = null;
|
||||||
|
|
|
@ -16,6 +16,7 @@ import org.springframework.test.context.junit.jupiter.EnabledIf;
|
||||||
import org.springframework.test.web.servlet.MockMvc;
|
import org.springframework.test.web.servlet.MockMvc;
|
||||||
|
|
||||||
import it.cnr.isti.epasmed.EpasmedApp;
|
import it.cnr.isti.epasmed.EpasmedApp;
|
||||||
|
import it.cnr.isti.epasmed.OfficeConstants;
|
||||||
import it.cnr.isti.epasmed.security.AuthoritiesConstants;
|
import it.cnr.isti.epasmed.security.AuthoritiesConstants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,21 +29,14 @@ import it.cnr.isti.epasmed.security.AuthoritiesConstants;
|
||||||
public class EPASTimeCardsResourceIT {
|
public class EPASTimeCardsResourceIT {
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
//private static final String OFFICE_DEFAULT_ID = "1";
|
|
||||||
//private static final String OFFICE_DEFAULT_NAME = "ISTI - Pisa";
|
|
||||||
//private static final String OFFICE_DEFAULT_CODE = "074000";
|
|
||||||
private static final String OFFICE_DEFAULT_CODEID = "225200";
|
|
||||||
|
|
||||||
private static final String PERSON_DEFAULT_ID = "113";
|
private static final String PERSON_DEFAULT_ID = "113";
|
||||||
//private static final String PERSON_DEFAULT_NAME = "Giuseppe";
|
private static final String PERSON_DEFAULT_FISCAL_CODE = "RMNVTR73C05H224X";
|
||||||
//private static final String PERSON_DEFAULT_SURNAME = "Amato";
|
private static final String PERSON_DEFAULT_EMAIL = "giancarlo.panichi@cnr.it";
|
||||||
//private static final String PERSON_DEFAULT_FISCAL_CODE = "MTAGPP68D15D976W";
|
|
||||||
private static final String PERSON_DEFAULT_FISCAL_CODE = "BRTNTN60R56E974Z";
|
private static final String YEAR_DEFAULT = "2025";
|
||||||
|
private static final String MONTH_DEFAULT = "1";
|
||||||
|
|
||||||
private static final String PERSON_DEFAULT_EMAIL = "giuseppe.amato@cnr.it";
|
|
||||||
//private static final String PERSON_DEFAULT_QUALIFICATION = "2";
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MockMvc restEPASTimeCardsMockMvc;
|
private MockMvc restEPASTimeCardsMockMvc;
|
||||||
|
@ -60,22 +54,22 @@ public class EPASTimeCardsResourceIT {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getTimeCardByPersonId() throws Exception {
|
public void getTimeCardByPersonId() throws Exception {
|
||||||
restEPASTimeCardsMockMvc.perform(get("/api/epas/timecards/byPerson?id="+PERSON_DEFAULT_ID+"&year=2022&month=6")).andExpect(status().isOk());
|
restEPASTimeCardsMockMvc.perform(get("/api/epas/timecards/byPerson?id="+PERSON_DEFAULT_ID+"&year="+YEAR_DEFAULT+"&month="+MONTH_DEFAULT)).andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getTimeCardByPersonFiscalCode() throws Exception {
|
public void getTimeCardByPersonFiscalCode() throws Exception {
|
||||||
restEPASTimeCardsMockMvc.perform(get("/api/epas/timecards/byPerson?fiscalCode="+PERSON_DEFAULT_FISCAL_CODE+"&year=2022&month=6")).andExpect(status().isOk());
|
restEPASTimeCardsMockMvc.perform(get("/api/epas/timecards/byPerson?fiscalCode="+PERSON_DEFAULT_FISCAL_CODE+"&year="+YEAR_DEFAULT+"&month="+MONTH_DEFAULT)).andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getTimeCardByPersonEmail() throws Exception {
|
public void getTimeCardByPersonEmail() throws Exception {
|
||||||
restEPASTimeCardsMockMvc.perform(get("/api/epas/timecards/byPerson?email="+PERSON_DEFAULT_EMAIL+"&year=2022&month=6")).andExpect(status().isOk());
|
restEPASTimeCardsMockMvc.perform(get("/api/epas/timecards/byPerson?email="+PERSON_DEFAULT_EMAIL+"&year="+YEAR_DEFAULT+"&month="+MONTH_DEFAULT)).andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getTimeCardByOfficeCodeId() throws Exception {
|
public void getTimeCardByOfficeCodeId() throws Exception {
|
||||||
restEPASTimeCardsMockMvc.perform(get("/api/epas/timecards/byOffice?codeId="+OFFICE_DEFAULT_CODEID+"&year=2022&month=6")).andExpect(status().isOk());
|
restEPASTimeCardsMockMvc.perform(get("/api/epas/timecards/byOffice?codeId="+OfficeConstants.ISTI_OFFICE_CODEID+"&year="+YEAR_DEFAULT+"&month="+MONTH_DEFAULT)).andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
import it.cnr.isti.epasmed.EpasmedApp;
|
import it.cnr.isti.epasmed.EpasmedApp;
|
||||||
|
import it.cnr.isti.epasmed.OfficeConstants;
|
||||||
import it.cnr.isti.epasmed.epas.model.EPASValidates;
|
import it.cnr.isti.epasmed.epas.model.EPASValidates;
|
||||||
import it.cnr.isti.epasmed.security.AuthoritiesConstants;
|
import it.cnr.isti.epasmed.security.AuthoritiesConstants;
|
||||||
|
|
||||||
|
@ -35,11 +36,12 @@ public class EPASValidatesResourceIT {
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
//private static final String OFFICE_DEFAULT_ID = "1";
|
private static final String PERSON_DEFAULT_EMAIL = "giancarlo.panichi@cnr.it";
|
||||||
// private static final String OFFICE_DEFAULT_NAME = "ISTI - Pisa";
|
|
||||||
// private static final String OFFICE_DEFAULT_CODE = "074000";
|
private static final String YEAR_DEFAULT = "2025";
|
||||||
private static final String OFFICE_DEFAULT_CODEID = "225200";
|
private static final String MONTH_DEFAULT = "1";
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MockMvc restEPASValidatesMockMvc;
|
private MockMvc restEPASValidatesMockMvc;
|
||||||
|
|
||||||
|
@ -55,8 +57,8 @@ public class EPASValidatesResourceIT {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void isValidatesByPersonEmail() throws Exception {
|
public void isValidatesByPersonEmail() throws Exception {
|
||||||
MvcResult result = restEPASValidatesMockMvc.perform(get("/api/epas/validates/is?email=giancarlo.panichi@cnr.it&"
|
MvcResult result = restEPASValidatesMockMvc.perform(get("/api/epas/validates/is?email="+PERSON_DEFAULT_EMAIL+"&"
|
||||||
+ "year=2021&month=11")).andExpect(status().isOk()).andReturn();
|
+ "year="+YEAR_DEFAULT+"&month="+MONTH_DEFAULT)).andExpect(status().isOk()).andReturn();
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
String validated = mapper.readValue(result.getResponse().getContentAsString(),
|
String validated = mapper.readValue(result.getResponse().getContentAsString(),
|
||||||
new TypeReference<String>() {
|
new TypeReference<String>() {
|
||||||
|
@ -66,8 +68,8 @@ public class EPASValidatesResourceIT {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getEPASValidatesByOfficeCodeId() throws Exception {
|
public void getEPASValidatesByOfficeCodeId() throws Exception {
|
||||||
MvcResult result = restEPASValidatesMockMvc.perform(get("/api/epas/validates?officeCodeId="+OFFICE_DEFAULT_CODEID+"&"
|
MvcResult result = restEPASValidatesMockMvc.perform(get("/api/epas/validates?officeCodeId="+OfficeConstants.ISTI_OFFICE_CODEID+"&"
|
||||||
+ "year=2021&month=11")).andExpect(status().isOk()).andReturn();
|
+ "year="+YEAR_DEFAULT+"&month="+MONTH_DEFAULT)).andExpect(status().isOk()).andReturn();
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
EPASValidates validates = mapper.readValue(result.getResponse().getContentAsString(),
|
EPASValidates validates = mapper.readValue(result.getResponse().getContentAsString(),
|
||||||
new TypeReference<EPASValidates>() {
|
new TypeReference<EPASValidates>() {
|
||||||
|
|
|
@ -22,6 +22,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
import it.cnr.isti.epasmed.EpasmedApp;
|
import it.cnr.isti.epasmed.EpasmedApp;
|
||||||
|
import it.cnr.isti.epasmed.OfficeConstants;
|
||||||
import it.cnr.isti.epasmed.epas.model.EPASWorkingTimeTypeDays;
|
import it.cnr.isti.epasmed.epas.model.EPASWorkingTimeTypeDays;
|
||||||
import it.cnr.isti.epasmed.epas.model.EPASWorkingTimeTypes;
|
import it.cnr.isti.epasmed.epas.model.EPASWorkingTimeTypes;
|
||||||
import it.cnr.isti.epasmed.security.AuthoritiesConstants;
|
import it.cnr.isti.epasmed.security.AuthoritiesConstants;
|
||||||
|
@ -38,11 +39,6 @@ public class EPASWorkingTimeTypesResourceIT {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(EPASWorkingTimeTypesResourceIT.class);
|
private static final Logger logger = LoggerFactory.getLogger(EPASWorkingTimeTypesResourceIT.class);
|
||||||
|
|
||||||
// private static final String OFFICE_DEFAULT_ID = "1";
|
|
||||||
// private static final String OFFICE_DEFAULT_NAME = "ISTI - Pisa";
|
|
||||||
// private static final String OFFICE_DEFAULT_CODE = "074000";
|
|
||||||
private static final String OFFICE_DEFAULT_CODEID = "225200";
|
|
||||||
|
|
||||||
private static final String DEFAULT_WORKING_TIME_TYPE_ID = "1";
|
private static final String DEFAULT_WORKING_TIME_TYPE_ID = "1";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -76,7 +72,7 @@ public class EPASWorkingTimeTypesResourceIT {
|
||||||
@Test
|
@Test
|
||||||
public void getWorkingTimeTypesList() throws Exception {
|
public void getWorkingTimeTypesList() throws Exception {
|
||||||
MvcResult result = restEPASWorkingTimeTypesMockMvc
|
MvcResult result = restEPASWorkingTimeTypesMockMvc
|
||||||
.perform(get("/api/epas/workingtimetypes?officeCodeId=" + OFFICE_DEFAULT_CODEID))
|
.perform(get("/api/epas/workingtimetypes?officeCodeId=" + OfficeConstants.ISTI_OFFICE_CODEID))
|
||||||
.andExpect(status().isOk()).andReturn();
|
.andExpect(status().isOk()).andReturn();
|
||||||
|
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
|
Loading…
Reference in New Issue