Aggiornato il test per la sincronizzazione

This commit is contained in:
Giancarlo Panichi 2022-09-21 17:22:39 +02:00
parent f6135d77f5
commit 3caea5bd36
2 changed files with 21 additions and 27 deletions

View File

@ -1293,7 +1293,7 @@ public class SyncService {
tab.setIdFlusso(fluxId);
tab.setLastUpdate(now);
tabsSIService.updateTabsSI(tab);
}
private TimeCardsReporting createTimeCardReporting(Long fluxId, String year, String month, LocalDateTime now) {

View File

@ -28,18 +28,16 @@ import it.cnr.isti.epasmed.security.AuthoritiesConstants;
public class SyncResourceIT {
private final Logger log = LoggerFactory.getLogger(getClass());
private static final String YEAR="2022";
private static final String MONTH="8";
private static final String YEAR = "2022";
private static final String MONTH = "7";
private static final String PERSON_DEFAULT_FISCAL_CODE = "CSTDTL57L65A864M";
@Autowired
private MockMvc restSyncMockMvc;
@Autowired
private Environment environment;
@BeforeEach
public void initTest() {
for (String profileName : environment.getActiveProfiles()) {
@ -50,40 +48,36 @@ public class SyncResourceIT {
@Test
public void syncReads() throws Exception {
restSyncMockMvc.perform(get("/api/sync/reads"))
.andExpect(status().is2xxSuccessful());
restSyncMockMvc.perform(get("/api/sync/reads")).andExpect(status().is2xxSuccessful());
}
@Test
public void syncWrites() throws Exception {
restSyncMockMvc.perform(get("/api/sync/writes?year="+YEAR+"&month="+MONTH))
.andExpect(status().is2xxSuccessful());
restSyncMockMvc.perform(get("/api/sync/writes?year=" + YEAR + "&month=" + MONTH))
.andExpect(status().is2xxSuccessful());
}
@Test
public void syncTest() throws Exception {
restSyncMockMvc.perform(get("/api/sync/test?year="+YEAR+"&month="+MONTH))
.andExpect(status().is2xxSuccessful());
restSyncMockMvc.perform(get("/api/sync/test?year=" + YEAR + "&month=" + MONTH))
.andExpect(status().is2xxSuccessful());
}
@Test
public void syncWritesOrario() throws Exception {
restSyncMockMvc.perform(get("/api/sync/writesOrario"))
.andExpect(status().is2xxSuccessful());
restSyncMockMvc.perform(get("/api/sync/writesOrario")).andExpect(status().is2xxSuccessful());
}
@Test
public void syncWritesTimeCards() throws Exception {
restSyncMockMvc.perform(get("/api/sync/writesTimeCards?year="+YEAR+"&month="+MONTH))
.andExpect(status().is2xxSuccessful());
restSyncMockMvc.perform(get("/api/sync/writesTimeCards?year=" + YEAR + "&month=" + MONTH))
.andExpect(status().is2xxSuccessful());
}
@Test
public void syncWritesOffSiteWorks() throws Exception {
restSyncMockMvc.perform(get("/api/sync/writesOffSiteWorks?year="+YEAR+"&month="+MONTH))
.andExpect(status().is2xxSuccessful());
public void syncWritesSingleTimeCards() throws Exception {
restSyncMockMvc.perform(get("/api/sync/writesSingleTimeCards?year=" + YEAR + "&month=" + MONTH + "&fiscalCode="
+ PERSON_DEFAULT_FISCAL_CODE));
}
}