TransactionEnd { public String transactionend(AAA aaa,EndTransactionInput input){ return aaa.checkUser(input.getUserId()); }  String transactionend(AAA aaa,EndTransactionInput input);  }
@Test public void testTransactionend() throws Exception { UserId userId = mock(UserId.class); when(aaa.checkUser(any(UserId.class))).thenReturn(new String("test")); when(input.getUserId()).thenReturn(userId); Assert.assertTrue(transactionEnd.transactionend(aaa,input).equals("test")); }