コード例 #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");
 }