Skip to content

Instantly share code, notes, and snippets.

@mihaita-tinta
Created March 9, 2021 14:04
Show Gist options
  • Save mihaita-tinta/803a08a1cc866c19c2aa1eb1c5fc4be8 to your computer and use it in GitHub Desktop.
Save mihaita-tinta/803a08a1cc866c19c2aa1eb1c5fc4be8 to your computer and use it in GitHub Desktop.
package com.mihaita.articles.caching;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import java.util.stream.IntStream;
@SpringBootTest(classes = {MyServiceTestConfiguration.class, MyCacheConfiguration.class},
properties = {"logging.level.org.springframework.cache=TRACE",
"logging.level.com.mihaita.articles.caching=TRACE"})
@ExtendWith(SpringExtension.class)
class MyServiceTest {
private static final Logger log = LoggerFactory.getLogger(MyServiceTest.class);
@Autowired
MyServiceTestConfiguration.MyService service;
@Test
public void test() {
IntStream.range(0, 10)
.forEach(i -> service.getStuffById(1));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment