METHOD_0 ( ) { when ( IDENT_0 . METHOD_1 ( METHOD_2 ( ) ) ) . thenReturn ( IDENT_1 ) ; when ( IDENT_1 . METHOD_3 ( ) ) . thenReturn ( IDENT_2 . IDENT_3 ) ; com . cloud . storage . IDENT_4 IDENT_5 = IDENT_6 . METHOD_4 ( com . cloud . storage . IDENT_5 . IDENT_7 . IDENT_8 , com . cloud . storage . IDENT_5 . IDENT_7 . IDENT_9 , com . cloud . storage . IDENT_5 . IDENT_7 . IDENT_10 , com . cloud . storage . IDENT_5 . IDENT_7 . IDENT_11 ) ; "<AssertPlaceHolder>" ; } METHOD_4 ( java . lang . Long , java . lang . Long , java . lang . Long , java . lang . Long ) { final com . cloud . IDENT_12 . IDENT_13 IDENT_12 = this . IDENT_0 . METHOD_1 ( IDENT_14 ) ; if ( IDENT_12 == null ) { throw new com . cloud . IDENT_15 . exceptions . METHOD_5 ( ( ( STRING_0 + IDENT_14 ) + STRING_1 ) ) ; } if ( ! ( IDENT_2 . IDENT_16 . equals ( IDENT_12 . METHOD_3 ( ) ) ) ) { throw new com . cloud . IDENT_15 . exceptions . METHOD_5 ( ( ( STRING_2 + ( IDENT_12 . METHOD_3 ( ) ) ) + STRING_3 ) ) ; } final com . cloud . IDENT_12 . IDENT_5 . IDENT_17 IDENT_18 = this . IDENT_19 . METHOD_1 ( IDENT_20 ) ; if ( IDENT_18 == null ) { throw new com . cloud . IDENT_15 . exceptions . METHOD_5 ( ( ( STRING_1 4 + IDENT_20 ) + STRING_1 ) ) ; } final com . cloud . IDENT_15 . user . IDENT_21 IDENT_22 = com . cloud . context . IDENT_23 . METHOD_6 ( ) . METHOD_7 ( ) ; this . IDENT_24 . METHOD_8 ( IDENT_22 , null , true , IDENT_18 ) ; final com . cloud . storage . IDENT_25 IDENT_5 = this . IDENT_26 . METHOD_1 ( IDENT_27 ) ; if ( IDENT_5 == null ) { throw new com . cloud . IDENT_15 . exceptions . METHOD_5 ( ( ( STRING_1 3 + IDENT_27 ) + STRING_1 ) ) ; } final com . cloud . engine . IDENT_28 . api . storage . IDENT_29 IDENT_30 = this . IDENT_31 . METHOD_9 ( IDENT_32 ) ; if ( IDENT_30 == null ) { throw new com . cloud . IDENT_15 . exceptions . METHOD_5 ( ( ( STRING_4 + IDENT_32 ) + STRING_1 ) ) ; } if ( ( IDENT_30 . METHOD_10 ( ) ) != ( com . cloud . IDENT_15 . IDENT_12 . IDENT_33 . IDENT_34 . IDENT_35 ) ) { throw new com . cloud . IDENT_15 . exceptions . METHOD_5 ( ( ( ( ( ( ( STRING_1 5 + IDENT_32 ) + STRING_5 ) + ( com . cloud . IDENT_15 . IDENT_12 . IDENT_33 . IDENT_34 . IDENT_35 ) ) + STRING_1 1 ) + ( IDENT_30 . METHOD_10 ( ) ) ) + STRING_1 2 ) ) ; } final com . cloud . engine . IDENT_28 . api . storage . IDENT_36 store = IDENT_30 . METHOD_11 ( ) ; final com . cloud . storage . datastore . db . IDENT_37 IDENT_38 = this . IDENT_39 . METHOD_12 ( store . METHOD_13 ( ) , store . getId ( ) , IDENT_32 ) ; if ( IDENT_38 != null ) { final com . cloud . storage . IDENT_25 IDENT_40 = this . IDENT_26 . METHOD_1 ( IDENT_38 . METHOD_14 ( ) ) ; if ( ( ( IDENT_40 != null ) && ( ( IDENT_38 . METHOD_15 ( ) ) != null ) ) && ( IDENT_38 . METHOD_15 ( ) . equals ( IDENT_18 . getName ( ) ) ) ) { throw new com . cloud . IDENT_15 . exceptions . METHOD_5 ( ( ( STRING_6 + ( IDENT_40 . METHOD_16 ( ) ) ) + STRING_1 0 ) ) ; } } com . cloud . engine . IDENT_28 . api . storage . IDENT_41 IDENT_42 = this . IDENT_43 . METHOD_17 ( IDENT_27 , store ) ; IDENT_42 = ( ( com . cloud . engine . IDENT_28 . api . storage . IDENT_41 ) ( store . create ( IDENT_42 ) ) ) ; final com . cloud . storage . datastore . db . IDENT_37 IDENT_44 = this . IDENT_39 . METHOD_18 ( IDENT_5 . getId ( ) , store . METHOD_13 ( ) ) ; IDENT_44 . METHOD_19 ( IDENT_45 . IDENT_34 . IDENT_35 ) ; IDENT_44 . METHOD_20 ( IDENT_18 . getName ( ) ) ; this . IDENT_39 . update ( IDENT_44 . getId ( ) , IDENT_44 ) ; IDENT_5 . METHOD_19 ( IDENT_4 . IDENT_34 . IDENT_46 ) ; this . IDENT_26 . update ( IDENT_5 . getId ( ) , IDENT_5 ) ; IDENT_42 = this . IDENT_43 . METHOD_17 ( IDENT_27 , store ) ; final java . lang . Long IDENT_47 = IDENT_12 . METHOD_21 ( ) ; try { final com . cloud . engine . IDENT_28 . api . storage . IDENT_48 IDENT_49 = this . IDENT_50 . METHOD_22 ( IDENT_5 , IDENT_51 . IDENT_52 ) ; if ( IDENT_49 == null ) { throw new com . cloud . IDENT_15 . exceptions . METHOD_23 ( ( ( STRING_7 + IDENT_27 ) + STRING_8 ) ) ; } IDENT_42 = IDENT_49 . METHOD_24 ( IDENT_42 ) ; } catch ( final java . lang . Exception e ) { com . cloud . storage . IDENT_5 . IDENT_53 . IDENT_54 . debug ( STRING_9 , e ) ; this . IDENT_55 . METHOD_25 ( IDENT_47 , IDENT_56 . IDENT_5 ) ; this . IDENT_55 . METHOD_25 ( IDENT_47 , IDENT_56 . IDENT_57 , IDENT_30 . METHOD_26 ( ) ) ; throw new com . cloud . IDENT_15 . exceptions . METHOD_23 ( STRING_9 , e ) ; } return IDENT_42 ; }
org . junit . Assert . assertNull ( IDENT_5 )