DebounceTest.java 616 B

123456789101112131415161718192021
  1. package com.izouma.nineth;
  2. import com.izouma.nineth.service.DebounceTestService;
  3. import org.junit.Test;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. public class DebounceTest extends ApplicationTests {
  6. @Autowired
  7. private DebounceTestService debounceTestService;
  8. @Test
  9. public void testDebounce() throws InterruptedException {
  10. String[] names = new String[]{"name1"};
  11. int c = 0;
  12. for (int i = 0; i < 1000000000; i++) {
  13. Thread.sleep(1);
  14. debounceTestService.testDebounce(names[i % names.length], String.valueOf(++c));
  15. }
  16. }
  17. }