CacheParamNameServices { public List<String> getMethodParamNames(Class cls, String methodName) { String key = cls.getName()+"."+methodName; if(!map.containsKey(key)) { List<String> result = new ArrayList(); try { ResourceBundle rb = ResourceBundle.getBundle(cls.getName(), Locale.US, cls.getClassLoader()); String property = rb.getString(key); result = Arrays.asList(property.split(Constants.Cache.PARAMNAME_SEPARATOR)); }catch(MissingResourceException mre) { } map.put(key, result); } return map.get(key); }  List<String> getMethodParamNames(Class cls, String methodName);  }
@Test public void testGetMethodParamNames() { System.out.println("getMethodParamNames"); instance.map.clear(); List<String> result = instance.getMethodParamNames(CacheAnnotedClass.class, "jsCacheRemovesAnnotatedMethod"); assertThat(result).hasSize(2); }
@Test public void testGetMethodParamNamesInCache() { System.out.println("getMethodParamNames"); instance.map.put(CacheAnnotedClass.class.getName()+".jsCacheRemovesAnnotatedMethod", Arrays.asList("a")); List<String> result = instance.getMethodParamNames(CacheAnnotedClass.class, "jsCacheRemovesAnnotatedMethod"); assertThat(result).hasSize(1); }
@Test public void testGetMethodParamNamesFail() { System.out.println("getMethodParamNames"); List<String> result = instance.getMethodParamNames(CacheAnnotedClass.class, "unknown"); assertThat(result).hasSize(0); }