@Test
public void testCollapser() throws ExecutionException, InterruptedException {
HystrixRequestContext context = HystrixRequestContext.initializeContext();
try {
User u1 = userService.getUser("1", "name: ");
User u2 = userService.getUser("2", "name: ");
User u3 = userService.getUser("3", "name: ");
User u4 = userService.getUser("4", "name: ");
assertEquals("name: 1", u1.getName());
assertEquals("name: 2", u2.getName());
assertEquals("name: 3", u3.getName());
assertEquals("name: 4", u4.getName());
com.netflix.hystrix.HystrixExecutableInfo<?> command = HystrixRequestLog.getCurrentRequest()
.getAllExecutedCommands().iterator().next();
assertEquals("getUser", command.getCommandKey().name());
//When a command is fronted by an HystrixCollapser then this marks how many requests are collapsed into the single command execution.