This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Arrays; | |
| import java.util.List; | |
| public class TestHelper { | |
| public static Throwable shouldFail(Runnable code) { | |
| try { | |
| code.run(); | |
| } catch (Throwable ex) { | |
| return ex; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Memoizer { | |
| public static class MemoizeFunction<T, R> implements Function<T, R> { | |
| private final Map<List, R> cache = new HashMap<>(); | |
| private final Function<T, R> function; | |
| public MemoizeFunction(Function<T, R> function) { | |
| Objects.requireNonNull(function); | |
| this.function = function; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Configuration | |
| @EnableCaching | |
| @ConditionalOnExpression("${spring.cacheable.cache}") | |
| public class EhCacheConfiguration { | |
| @Autowired | |
| private net.sf.ehcache.CacheManager cacheManager; | |
| @Bean(name = "cacheManager") | |
| public CacheManager ehCacheCacheManager() |
OlderNewer