2012-03-29 10 views
0

我已經寫了簡單的應用程序來模擬字符串,但是當我運行,我得到下面的錯誤我自己的類的模擬對象:無法創建

30 Mar, 2012 2:32:19 PM - NOTE : Start Processing Annotations 
30 Mar, 2012 2:32:19 PM - NOTE : Processing [public void testObject() ] 
30 Mar, 2012 2:32:19 PM - NOTE : Adding Class to Mocking List: java.lang.String 
30 Mar, 2012 2:32:19 PM - NOTE : Found 1 classes to mock 
30 Mar, 2012 2:32:19 PM - NOTE : Mocking class java.lang.String 
30 Mar, 2012 2:32:19 PM - NOTE : Found 0 mocked classes to save 
30 Mar, 2012 2:32:19 PM - NOTE : Finished Processing Mocks 
30 Mar, 2012 2:32:19 PM - NOTE : Start Processing Annotations 
30 Mar, 2012 2:32:19 PM - NOTE : Processing [] 
30 Mar, 2012 2:32:19 PM - NOTE : Found 0 classes to mock 
30 Mar, 2012 2:32:19 PM - NOTE : Found 0 mocked classes to save 
30 Mar, 2012 2:32:19 PM - NOTE : Finished Processing Mocks 
30 Mar, 2012 2:34:51 PM - NOTE : Start Processing Annotations 
30 Mar, 2012 2:34:51 PM - NOTE : Processing [public void testObject() ] 
30 Mar, 2012 2:34:51 PM - NOTE : Adding Class to Mocking List: java.lang.String 
30 Mar, 2012 2:34:51 PM - NOTE : Found 1 classes to mock 
30 Mar, 2012 2:34:51 PM - NOTE : Mocking class java.lang.String 
30 Mar, 2012 2:34:51 PM - NOTE : Found 0 mocked classes to save 
30 Mar, 2012 2:34:51 PM - NOTE : Finished Processing Mocks 
30 Mar, 2012 2:34:51 PM - NOTE : Start Processing Annotations 
30 Mar, 2012 2:34:51 PM - NOTE : Processing [] 
30 Mar, 2012 2:34:51 PM - NOTE : Found 0 classes to mock 
30 Mar, 2012 2:34:51 PM - NOTE : Found 0 mocked classes to save 
30 Mar, 2012 2:34:51 PM - NOTE : Finished Processing Mocks 
30 Mar, 2012 2:35:20 PM - NOTE : Start Processing Annotations 
30 Mar, 2012 2:35:20 PM - NOTE : Processing [public void testObject() ] 
30 Mar, 2012 2:35:20 PM - NOTE : Adding Class to Mocking List: java.lang.String 
30 Mar, 2012 2:35:20 PM - NOTE : Found 1 classes to mock 
30 Mar, 2012 2:35:20 PM - NOTE : Mocking class java.lang.String 
30 Mar, 2012 2:35:20 PM - NOTE : Found 0 mocked classes to save 
30 Mar, 2012 2:35:20 PM - NOTE : Finished Processing Mocks 
30 Mar, 2012 2:35:20 PM - NOTE : Start Processing Annotations 
30 Mar, 2012 2:35:20 PM - NOTE : Processing [] 
30 Mar, 2012 2:35:20 PM - NOTE : Found 0 classes to mock 
30 Mar, 2012 2:35:20 PM - NOTE : Found 0 mocked classes to save 
30 Mar, 2012 2:35:20 PM - NOTE : Finished Processing Mocks 

回答

1

我知道我可能遲到這個答案,但我會說它不能被嘲笑,因爲String類是final的。