package com.raillearn;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import java.util.ArrayList;

@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Bean
    public TripRepository tripRepository() {
        Departure departure = new Departure("Warszawa", "04.04.2016", "17:50");
        Route route = new Route(departure, "Olsztyn", new ArrayList<Departure>());
        User user = new User("photo", "Karolka", "0");
        Offer offer = new Offer("Spanish","Hi! Learn spanish with me!");

        Route route2 = new Route(departure, "Gdańsk", new ArrayList<Departure>());
        User user2 = new User("photo", "Obywatel Miś", "0");

        TripRepository tripRepository = new TripRepository();
        tripRepository.save(new Trip("0", route, user, offer));
        tripRepository.save(new Trip("0", route2, user2, offer));
        tripRepository.save(new Trip("0", route, user2, offer, "some_joined_user_id"));
        return tripRepository;
    }

    @Bean
    public UserRepository userRepository() {
        return new UserRepository();
    }
}

@@ -424,32 +424,331 @@
 ipRepository() %7B
+%0A%0A        TripRepository tripRepository = new TripRepository();%0A        addTestData(tripRepository);%0A        return tripRepository;%0A    %7D%0A%0A    @Bean%0A    public UserRepository userRepository() %7B%0A        return new UserRepository();%0A    %7D%0A%0A    private void addTestData(TripRepository tripRepository) %7B
 %0A        Departu
@@ -793,17 +793,17 @@
 %22, %2204.0
-4
+6
 .2016%22, 
@@ -939,18 +939,16 @@
 , %22Karol
-ka
 %22, %220%22);
@@ -985,49 +985,153 @@
 er(%22
-Spanish%22,%22Hi! Learn spanish with me!
+Hiszpa%C5%84ski%22,%22Cze%C5%9B%C4%87! Ucz si%C4%99 ze mn%C4%85 hiszpa%C5%84skiego - poziom A2.%22);%0A%0A        Departure departure2 = new Departure(%22Krak%C3%B3w%22, %2202.06.2016%22, %2212:50
 %22);%0A
-%0A
     
@@ -1168,16 +1168,17 @@
 eparture
+2
 , %22Gda%C5%84s
@@ -1275,70 +1275,841 @@
 %22);%0A
-%0A        TripRepository tripRepository = new TripRepository();
+        Offer offer2 = new Offer(%22Matematyka%22,%22Korepetycje z analizy matematycznej 1-2 rok studi%C3%B3w%22);%0A%0A        Departure departure3 = new Departure(%22Bydgoszcz%22, %2230.05.2016%22, %2210:15%22);%0A        Route route3 = new Route(departure3, %22Warszawa%22, new ArrayList%3CDeparture%3E());%0A        User user3 = new User(%22photo%22, %22Asia J.%22, %220%22);%0A        Offer offer3 = new Offer(%22Francuski%22,%22Konwersacje po francusku poziom B2%22);%0A%0A        Departure departure4 = new Departure(%22Warszawa%22, %2208.06.2016%22, %2218:15%22);%0A        Route route4 = new Route(departure4, %22Wroc%C5%82aw%22, new ArrayList%3CDeparture%3E());%0A        Offer offer4 = new Offer(%22Angielski%22,%22Pomog%C4%99 w przygotowaniu do egzaminu FCE%22);%0A%0A        Departure departure5 = new Departure(%22Wroc%C5%82aw%22, %2210.06.2016%22, %2215:25%22);%0A        Route route5 = new Route(departure5, %22Warszawa%22, new ArrayList%3CDeparture%3E());%0A
 %0A   
@@ -2227,24 +2227,25 @@
 user2, offer
+2
 ));%0A        
@@ -2287,45 +2287,24 @@
 oute
+3
 , user
-2
+3
 , offer
-, %22some_joined_user_id%22
+3
 ));%0A
@@ -2303,39 +2303,32 @@
 fer3));%0A        
-return 
 tripRepository;%0A
@@ -2329,106 +2329,117 @@
 tory
-;%0A    %7D%0A%0A    @Bean%0A    public UserRepository userRepository() %7B%0A        return new UserRepository(
+.save(new Trip(%220%22, route4, user3, offer4));%0A        tripRepository.save(new Trip(%220%22, route5, user3, offer4)
 );%0A 

Add test data.