TransactionBegin { public String transactionbegin(AAA aaa,BeginTransactionInput input){ return aaa.checkUser(input.getUserId()); }  String transactionbegin(AAA aaa,BeginTransactionInput input);  }
@Test public void testTransactionbegin() throws Exception { String result; UserId userId = mock(UserId.class); when(aaa.checkUser(any(UserId.class))).thenReturn(new String("test")); when(input.getUserId()).thenReturn(userId); result = transactionBegin.transactionbegin(aaa,input); Assert.assertTrue(result.equals("test")); }