METHOD_0 ( ) { com . IDENT_0 . IDENT_1 . IDENT_2 . IDENT_3 . IDENT_4 IDENT_5 = IDENT_3 . IDENT_4 . newInstance ( ) ; com . IDENT_0 . IDENT_1 . IDENT_6 . IDENT_7 parameters = mock ( com . IDENT_0 . IDENT_1 . IDENT_6 . IDENT_7 . class , com . IDENT_0 . IDENT_1 . repository . database . IDENT_8 ) ; when ( parameters . METHOD_1 ( ) . METHOD_1 ( ) ) . thenReturn ( STRING_0 ) ; java . util . Date from = mock ( java . util . Date . class ) ; java . util . Date to = mock ( java . util . Date . class ) ; when ( parameters . METHOD_2 ( ) ) . thenReturn ( from ) ; when ( parameters . METHOD_3 ( ) ) . thenReturn ( to ) ; java . util . List < java . lang . String > IDENT_9 = new java . util . ArrayList < java . lang . String > ( ) ; IDENT_9 . add ( STRING_1 ) ; when ( parameters . METHOD_4 ( ) ) . thenReturn ( IDENT_9 ) ; java . util . List < java . util . Map > expected = mock ( java . util . List . class ) ; when ( transaction . select ( anyString ( ) , org . mockito . Matchers . METHOD_5 ( ) ) ) . thenReturn ( expected ) ; java . util . List < java . util . Map > result = IDENT_10 . METHOD_6 ( IDENT_5 , parameters ) ; "<AssertPlaceHolder>" ; METHOD_7 ( new java . lang . RuntimeException ( ) ) . when ( transaction ) . select ( anyString ( ) , org . mockito . Matchers . METHOD_5 ( ) ) ; IDENT_10 . METHOD_6 ( IDENT_5 , parameters ) ; org . junit . Assert . fail ( ) ; } METHOD_6 ( com . IDENT_0 . IDENT_1 . IDENT_2 . IDENT_11 , com . IDENT_0 . IDENT_1 . IDENT_6 . IDENT_7 ) { try { java . util . Date IDENT_12 = parameters . METHOD_2 ( ) ; java . util . Date IDENT_13 = parameters . METHOD_3 ( ) ; java . lang . String IDENT_14 = STRING_2 ; java . lang . StringBuilder IDENT_15 = new java . lang . StringBuilder ( STRING_3 ) ; java . util . List params = new java . util . ArrayList ( ) ; params . add ( IDENT_16 ) ; params . add ( parameters . METHOD_1 ( ) . METHOD_1 ( ) ) ; if ( IDENT_12 != null ) { params . add ( IDENT_12 ) ; IDENT_15 . append ( STRING_4 ) ; } if ( IDENT_13 != null ) { params . add ( IDENT_13 ) ; IDENT_15 . append ( STRING_5 ) ; } METHOD_8 ( parameters , IDENT_15 , params ) ; java . lang . Object [ ] IDENT_17 = new java . lang . Object [ params . size ( ) ] ; params . toArray ( IDENT_17 ) ; java . lang . String IDENT_18 = ( ( ( STRING_6 + IDENT_14 ) + STRING_7 ) + ( IDENT_15 . toString ( ) ) ) + STRING_8 ; java . util . List < java . util . Map > IDENT_19 = transaction . select ( IDENT_18 , IDENT_17 ) ; return IDENT_19 ; } catch ( java . lang . Exception e ) { throw new com . IDENT_0 . IDENT_1 . repository . METHOD_9 ( STRING_9 , e ) ; } }
org . junit . Assert . assertThat ( result , org . hamcrest . core . Is . is ( expected ) )