func init() {
	go func() {
		// Start our webapp
		fakeRemote := dsb.NewDSBFacadeWithEndpoint("http://localhost:7777")
		http.ListenAndServe(fmt.Sprintf(":8081"), main.WebAppWithFacade(fakeRemote))
	}()
}
Exemple #2
0
// Not a test
func loadData(t *testing.T) *models.TrainEventList {

	// quickest way
	mockserver.HttpServerDSBTestApi(t, 44444)
	remoteAPI := dsb.NewDSBFacadeWithEndpoint("http://localhost:44444")
	successC, errC := remoteAPI.GetTrains("", "")

	select {
	case response := <-successC:
		return response
	case <-errC:
		return &models.TrainEventList{nil}
	}
}