added unit tests for the roster #89
|
@ -4,14 +4,11 @@ import java.util.List;
|
|||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import ch.unisg.roster.roster.adapter.out.persistence.mongodb.RosterRepository;
|
||||
import ch.unisg.roster.roster.application.port.in.LoadRosterItemPort;
|
||||
import ch.unisg.roster.roster.domain.Roster;
|
||||
import ch.unisg.roster.roster.domain.RosterItem;
|
||||
import org.eclipse.paho.client.mqttv3.MqttException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
|
@ -29,14 +26,14 @@ public class RosterApplication {
|
|||
|
||||
private static ConfigurableEnvironment ENVIRONMENT;
|
||||
|
||||
@Autowired
|
||||
private LoadRosterItemPort loadRosterItemPort;
|
||||
private static LoadRosterItemPort loadRosterItemPort;
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
|
||||
SpringApplication rosterApp = new SpringApplication(RosterApplication.class);
|
||||
ENVIRONMENT = rosterApp.run(args).getEnvironment();
|
||||
bootstrapMarketplaceWithMqtt();
|
||||
initialiseRoster();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -55,9 +52,9 @@ public class RosterApplication {
|
|||
}
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
private void initialiseRoster(){
|
||||
Roster.getInstance().initialiseRoster(loadRosterItemPort.loadAllRosterItems());
|
||||
private static void initialiseRoster(){
|
||||
List<RosterItem> rosterItemList = loadRosterItemPort.loadAllRosterItems();
|
||||
Roster.getInstance().initialiseRoster(rosterItemList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user
Let's make sure this is needed