### Question:
DynamicUrlHandler implements UrlHandler { @Override public void configure(Context context) { urlContext = loadUrlContext(context); filterHandler = getFilterHandler(urlContext); }  @Override String buildUrl(Map<String, String> properties); @Override void updateFilterParameters(String filterParameters); @Override void configure(Context context); static final String URL_CONF; }### Answer:
@Test(expected=RestSourceException.class) public void testJson() throws Exception { context.put("urlJson", URL_JSON); dynamicUrlHandler = new DynamicUrlHandler(); try{ dynamicUrlHandler.configure(context); }catch(RestSourceException e){ assertNotNull(e.getMessage()); assertEquals(e.getMessage(), "An error occurred during FilterHandler instantiation"); } }
@Test public void testBadJson() { context.put("urlJson", BAD_URL_JSON); dynamicUrlHandler = new DynamicUrlHandler(); try{ dynamicUrlHandler.configure(context); }catch(RestSourceException e){ assertNotNull(e.getMessage()); assertEquals(e.getMessage(), "An error ocurred while json parsing. Verify configuration file"); } }
@Test public void testEmptyJson() throws Exception { context.put("urlJson", EMPTY_URL_JSON); dynamicUrlHandler = new DynamicUrlHandler(); try{ dynamicUrlHandler.configure(context); }catch(RestSourceException e){ assertNotNull(e.getMessage()); assertEquals(e.getMessage(), "An error ocurred while json parsing. Verify configuration file"); } }