Skip to content

Commit 4126b80

Browse files
committed
prevent abuse of mock
1 parent 9b3cc8d commit 4126b80

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

aliyun-java-sdk-core/src/test/java/com/aliyuncs/CommonResponseTest.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
import org.junit.Before;
88
import org.junit.Test;
99

10-
import static org.mockito.Mockito.mock;
11-
1210
public class CommonResponseTest {
1311
private CommonResponse response;
1412

@@ -25,14 +23,14 @@ public void getSetTest() {
2523
response.setHttpStatus(200);
2624
Assert.assertEquals(200, response.getHttpStatus());
2725

28-
HttpResponse httpResponse = mock(HttpResponse.class);
26+
HttpResponse httpResponse = new HttpResponse();
2927
response.setHttpResponse(httpResponse);
3028
Assert.assertTrue(httpResponse == response.getHttpResponse());
3129
}
3230

3331
@Test
3432
public void getInstanceTest() throws ClientException {
35-
UnmarshallerContext context = mock(UnmarshallerContext.class);
33+
UnmarshallerContext context = new UnmarshallerContext();
3634
Assert.assertNull(response.getInstance(context));
3735
}
3836

0 commit comments

Comments
 (0)