Skip to content

Commit

Permalink
Secons attempt fixing test in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fransjacobs committed Jan 7, 2025
1 parent 7cf9718 commit 4b0fc73
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import org.tinylog.Logger;

/**
*
Expand All @@ -45,16 +46,16 @@ public class EsuEcosCommandStationImplTest {
public EsuEcosCommandStationImplTest() {
System.setProperty("message.debug", "true");
System.setProperty("persistenceService", "jcs.persistence.H2PersistenceService");

testHelper = PersistenceTestHelper.getInstance();
}

private CommandStationBean getEcosAsDefaultCommandStationBean() {
CommandStationBean ecosCommandStationBean = new CommandStationBean();
ecosCommandStationBean.setId("esu-ecos");
PersistenceFactory.getService().changeDefaultCommandStation(ecosCommandStationBean);
ecosCommandStationBean = PersistenceFactory.getService().getDefaultCommandStation();

CommandStationBean ecosCommandStationBean = PersistenceFactory.getService().getDefaultCommandStation();

if(ecosCommandStationBean == null) {
Logger.error("ESU ECoS Command Sation is NULL!");
}

ecosCommandStationBean.setIpAddress(NetworkUtil.getIPv4HostAddress().getHostAddress());
PersistenceFactory.getService().persist(ecosCommandStationBean);
return ecosCommandStationBean;
Expand All @@ -63,6 +64,7 @@ private CommandStationBean getEcosAsDefaultCommandStationBean() {
@BeforeEach
public void setUp() {
testHelper.runTestDataInsertScript("ecos_test_data.sql");

this.commandStationBean = getEcosAsDefaultCommandStationBean();
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/ecos_test_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -394,4 +394,4 @@ INSERT INTO jcs.sensors (id,name,device_id,contact_id,status,previous_status,mil
('0-0007','B0-S-7',0,7,0,1,NULL,NULL),
('0-0009','B0-S-9',0,9,0,NULL,NULL,NULL);

commit;
commit;

0 comments on commit 4b0fc73

Please sign in to comment.