### Question:
WXImage extends WXComponent<ImageView> { @WXComponentProp(name = Constants.Name.RESIZE) public void setResize(String resize) { setResizeMode(resize); } @Deprecated  WXImage(WXSDKInstance instance, WXVContainer parent, String instanceId, boolean isLazy, BasicComponentData basicComponentData);  WXImage(WXSDKInstance instance, WXVContainer parent, BasicComponentData basicComponentData); @Override void refreshData(WXComponent component); @WXComponentProp(name = Constants.Name.RESIZE_MODE) void setResizeMode(String resizeMode); @WXComponentProp(name = Constants.Name.RESIZE) void setResize(String resize); @WXComponentProp(name = Constants.Name.SRC) void setSrc(String src); @Override void recycled(); void autoReleaseImage(); void autoRecoverImage(); @Override void updateProperties(Map<String, Object> props); @JSMethod(uiThread = false) void save(final JSCallback saveStatuCallback); @Override void destroy(); static final String SUCCEED; static final String ERRORDESC; }### Answer:
@Test public void testSetResize() throws Exception { ImageView imageView = mWXImage.initComponentHostView(Robolectric.setupActivity(TestActivity.class)); mWXImage.mHost = imageView; mWXImage.setResize("cover"); ImageView.ScaleType scaleType = mWXImage.getHostView().getScaleType(); assertEquals(scaleType, ImageView.ScaleType.CENTER_CROP); }