Buggy code:
@ RunWith ( SpringJUnit4ClassRunner . class ) @ ContextConfiguration ( "classpath:spring//library-context.xml" ) public class BookControllerTest { private static SimpleDateFormat format ; @ Autowired @ Qualifier ( "bookMapper" ) private BookMapper bMap ; @ Autowired @ Qualifier ( "authorMapper" ) private AuthorMapper aMap ; public BookControllerTest ( ) { } @ BeforeClass public static void setUpClass ( ) { } @ AfterClass public static void tearDownClass ( ) { } @ Before public void setUp ( ) { } @ After public void tearDown ( ) { } @ Test public void bogusSpringTest ( ) { } @ Test public void addBookTest ( ) throws ParseException { Author a1 = new Author ( ) ; a1 . setLastName ( "Tsui" ) ; a1 . setFirstName ( "Frank" ) ; Author a2 = new Author ( ) ; a2 . setLastName ( "Karam" ) ; a2 . setFirstName ( "Orlando" ) ; Author a3 = new Author ( ) ; a3 . setLastName ( "Bernal" ) ; a3 . setFirstName ( "Barbara" ) ; List < Author > aList = new LinkedList < > ( ) ; aList . add ( a1 ) ; aList . add ( a2 ) ; aList . add ( a3 ) ; Book b = new Book ( ) ; b . setISBN13 ( "978-1449691998" ) ; b . setISBN10 ( "1449691994" ) ; b . setTitle ( "Essentials<seq2seq4repair_space>Of<seq2seq4repair_space>Software<seq2seq4repair_space>Engineering" ) ; b . setStatus ( CHECKEDIN ) ; b . setAuthors ( aList ) ; <START_BUG> b . setPublishDate ( BookControllerTest . format . parse ( "02//13//2013" ) ) ; <END_BUG> Long id = bMap . addBook ( b ) ; assertEquals ( "ISBN13<seq2seq4repair_space>Doesn't<seq2seq4repair_space>match<seq2seq4repair_space>Expected!" , "978-1449691998" , bMap . getBookById ( id ) . getISBN13 ( ) ) ; assertEquals ( "ISBN10<seq2seq4repair_space>Doesn't<seq2seq4repair_space>match<seq2seq4repair_space>Expected!" , "1449691994" , bMap . getBookById ( id ) . getISBN10 ( ) ) ; assertEquals ( "Title<seq2seq4repair_space>Doesn't<seq2seq4repair_space>match<seq2seq4repair_space>Expected!" , "Essentials<seq2seq4repair_space>Of<seq2seq4repair_space>Software<seq2seq4repair_space>Engineering" , bMap . getBookById ( id ) . getTitle ( ) ) ; assertEquals ( "Book<seq2seq4repair_space>Status<seq2seq4repair_space>Doesn't<seq2seq4repair_space>match<seq2seq4repair_space>Expected!" , CHECKEDIN , bMap . getBookById ( id ) . getStatus ( ) ) ; assertEquals ( "Author<seq2seq4repair_space>1<seq2seq4repair_space>First<seq2seq4repair_space>Name<seq2seq4repair_space>Doesn't<seq2seq4repair_space>match<seq2seq4repair_space>Expected!" , "Frank" , bMap . getBookById ( id ) . getAuthors ( ) . get ( 0 ) . getFirstName ( ) ) ; assertEquals ( "Author<seq2seq4repair_space>2<seq2seq4repair_space>First<seq2seq4repair_space>Name<seq2seq4repair_space>Doesn't<seq2seq4repair_space>match<seq2seq4repair_space>Expected!" , "Orlando" , bMap . getBookById ( id ) . getAuthors ( ) . get ( 1 ) . getFirstName ( ) ) ; assertEquals ( "Author<seq2seq4repair_space>3<seq2seq4repair_space>First<seq2seq4repair_space>Name<seq2seq4repair_space>Doesn't<seq2seq4repair_space>match<seq2seq4repair_space>Expected!" , "Barbara" , bMap . getBookById ( id ) . getAuthors ( ) . get ( 2 ) . getFirstName ( ) ) ; assertEquals ( "Author<seq2seq4repair_space>1<seq2seq4repair_space>Last<seq2seq4repair_space>Name<seq2seq4repair_space>Doesn't<seq2seq4repair_space>match<seq2seq4repair_space>Expected!" , "Tsui" , bMap . getBookById ( id ) . getAuthors ( ) . get ( 0 ) . getLastName ( ) ) ; assertEquals ( "Author<seq2seq4repair_space>2<seq2seq4repair_space>Last<seq2seq4repair_space>Name<seq2seq4repair_space>Doesn't<seq2seq4repair_space>match<seq2seq4repair_space>Expected!" , "Karam" , bMap . getBookById ( id ) . getAuthors ( ) . get ( 1 ) . getLastName ( ) ) ; assertEquals ( "Author<seq2seq4repair_space>3<seq2seq4repair_space>Last<seq2seq4repair_space>Name<seq2seq4repair_space>Doesn't<seq2seq4repair_space>match<seq2seq4repair_space>Expected!" , "Bernal" , bMap . getBookById ( id ) . getAuthors ( ) . get ( 2 ) . getLastName ( ) ) ; assertEquals ( "Publisher<seq2seq4repair_space>Date<seq2seq4repair_space>Doesn't<seq2seq4repair_space>match<seq2seq4repair_space>Expected!" , BookControllerTest . format . parse ( "2013-02-13" ) , bMap . getBookById ( id ) . getPublishDate ( ) ) ; } }

Fix:
b . setPublishDate ( BookControllerTest . format . parse ( "2013-02-13" ) ) ;