### Question:
WookieWidgetMetadataResolver implements WidgetMetadataResolver { @Override public Widget[] getMetadataGroup(String url) { try { return widgetMetadataRepository.getWidgetMetadata(); } catch (Exception e) { throw new IllegalArgumentException("Error occurred while processing response for Widget (group) metadata call", e); } } @Autowired  WookieWidgetMetadataResolver(@Qualifier("wookieWidgetService") WidgetProviderService widgetService); String getSupportedContext(); Widget getMetadata(String url); @Override Widget[] getMetadataGroup(String url); @Override Widget publishRemote(String url);  }### Answer:
@Test public void getAllWidgets() throws IOException, WookieConnectorException { Widget[] results = new Widget[]{TEST_WIDGET}; expect(wookieWidgetMetadataRepository.getWidgetMetadata()).andReturn(results); replay(wookieWidgetMetadataRepository); expect(widgetService.getWidgets()).andReturn(results); replay(widgetService); Widget[] widgets = widgetMetadataResolver.getMetadataGroup(VALID_GROUP_IDENTIFIER); assertEquals(1, widgets.length); assertEquals("freeder", widgets[0].getTitle()); assertEquals("http: assertEquals("An RSS reader widget optimised for small screens or desktop widgets.", widgets[0].getDescription()); assertEquals("http: assertEquals(TYPE, widgets[0].getType()); }