### Question:
ApiMediationServiceConfigReader { public Map<String, String> setApiMlServiceContext(ServletContext servletContext) { Map<String, String> threadContextMap = ObjectUtil.getThreadContextMap(threadConfigurationContext); Enumeration<String> paramNames = servletContext.getInitParameterNames(); while (paramNames.hasMoreElements()) { String param = paramNames.nextElement(); String value = servletContext.getInitParameter(param); if (param.startsWith("apiml.")) { threadContextMap.put(param, value); } } return threadContextMap; } ApiMediationServiceConfigReader(); ApiMediationServiceConfig mergeConfigurations(ApiMediationServiceConfig defaultConfiguration, ApiMediationServiceConfig additionalConfiguration); ApiMediationServiceConfig loadConfiguration(String internalConfigurationFileName); ApiMediationServiceConfig loadConfiguration(String internalConfigFileName, String externalizedConfigFileName); static void setServiceIpAddress(ApiMediationServiceConfig serviceConfig); ApiMediationServiceConfig buildConfiguration(String fileName); ApiMediationServiceConfig buildConfiguration(String fileName, Map<String, String> properties); Map<String, String> setApiMlServiceContext(ServletContext servletContext); ApiMediationServiceConfig loadConfiguration(ServletContext context); static final String APIML_DEFAULT_CONFIG; static final String APIML_ADDITIONAL_CONFIG; }### Answer:
@Test public void testSetApiMlContext_Ok() { ServletContext context = getMockServletContext(); ApiMediationServiceConfigReader reader = new ApiMediationServiceConfigReader(); Map<String, String> contextMap = reader.setApiMlServiceContext(context); checkContextMap(contextMap); }
@Test public void testSetApiMlContextTwice_Ok() { ServletContext context = getMockServletContext(); ApiMediationServiceConfigReader reader = new ApiMediationServiceConfigReader(); Map<String, String> contextMap = reader.setApiMlServiceContext(context); checkContextMap(contextMap); }