예제 #1
0
  @Test
  public void testUserCorrectFromPlainOldJUnitTest() {

    UserStory story = (UserStory) ac.getBean("userStory");
    // Spring is working fine using this app context
    assertEquals(story.getUser().getRole(), "SuperGenius User");

    // In this case our User is not wired up
    UserStory story2 = new UserStory();
    assertNull(story2.getUser());
  }
예제 #2
0
 @Test
 public void testPrewiredUserCorrect() {
   UserStory story = (UserStory) ac.getBean("userStory");
   assertEquals(story.getUser().getRole(), "SuperGenius User");
 }