Advertisement
Guest User

Untitled

a guest
May 6th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. @SpringBootApplication
  2. @EnableAutoConfiguration
  3. public class Main
  4. {
  5. public static void main(String[] args)
  6. {
  7. // Run the spring application and return the context
  8. ApplicationContext ctx = SpringApplication.run(Main.class, args);
  9.  
  10. // The the Meeting controller that is annotated using @Controller
  11. // Within the Meeting controller the persistence manager is autowired
  12. MeetingController meetingController = ctx.getBean(MeetingController.class);
  13.  
  14. // Create some sample data that depicts some meetings you had today.
  15. Meeting dailyStandup = new Meeting();
  16. dailyStandup.setDescription("Meeting that is supposed to be 15 minutes but never really is.");
  17. dailyStandup.setLocation("Aspen"); // Because every office has a meeting room called Aspen for some reason
  18. dailyStandup.setNotes("Kinda Boring but mostly comatose because I was busy working all night on fun Onyx work");
  19.  
  20. Meeting bugTriage = new Meeting();
  21. bugTriage.setDescription("Meeting for QA to air their grievances");
  22. bugTriage.setLocation("Telluride");
  23. bugTriage.setNotes("Really Really Boring");
  24.  
  25. Meeting dataArchitectureDiscussion = new Meeting();
  26. dataArchitectureDiscussion.setDescription("Exciting meeting about implementing a new database that will make my life easier called Onyx");
  27. dataArchitectureDiscussion.setLocation("Dev Studio");
  28. dataArchitectureDiscussion.setNotes("Exciting!!!");
  29.  
  30. meetingController.saveMeeting(dailyStandup);
  31. meetingController.saveMeeting(bugTriage);
  32. meetingController.saveMeeting(dataArchitectureDiscussion);
  33.  
  34. List<Meeting> booringMeetings = meetingController.findBoringMeetings();
  35.  
  36. assert booringMeetings.size() == 2;
  37.  
  38. // Exit the Spring boot application.
  39. exit(0);
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement