String objectName = "bogusImageConfigurable";
String iconKey = objectName + ".image";
Image expectedImage = new BufferedImage(32, 32, BufferedImage.TYPE_INT_RGB);
// Create the required mock objects
ImageSource imageSource = (ImageSource) EasyMock.createMock(ImageSource.class);
ImageConfigurable configurable = (ImageConfigurable) EasyMock.createMock(ImageConfigurable.class);
// Create the configurer with the mock image source
DefaultApplicationObjectConfigurer configurer = new DefaultApplicationObjectConfigurer(null, imageSource, null,
null);
EasyMock.expect(imageSource.getImage(iconKey)).andReturn(expectedImage);
configurable.setImage(expectedImage);
EasyMock.replay(imageSource);
EasyMock.replay(configurable);