method under test : findgame string scenario : when game is found expectation : it will return game object concode_field_sep Session session concode_elem_sep GameDao gameDao concode_elem_sep Query query concode_elem_sep SessionFactory sessionFactory concode_elem_sep String gameName concode_field_sep void testSaveGame concode_elem_sep void setUp concode_elem_sep void testFindGameWhenGameIsNotFound concode_elem_sep void tearDown
void function ( ) { List < Game > loc0 = new ArrayList < Game > ( ) ; loc0 . add ( new Game ( ) ) ; Mockito . when ( query . list ( ) ) . thenReturn ( loc0 ) ; Assert . assertNotNull ( gameDao . findGame ( gameName ) ) ; Assert . assertTrue ( ! loc0 . isEmpty ( ) ) ; }