Fixes as per editor Suggestions

This commit is contained in:
Ankur Gupta 2020-04-18 15:52:19 +05:30
parent a6dc193437
commit d7ee1a9699
3 changed files with 53 additions and 54 deletions

View File

@ -1,54 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<modelVersion>4.0.0</modelVersion> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>spring-caching</artifactId> <modelVersion>4.0.0</modelVersion>
<version>0.1-SNAPSHOT</version> <artifactId>spring-caching</artifactId>
<name>spring-caching</name> <version>0.1-SNAPSHOT</version>
<packaging>war</packaging> <name>spring-caching</name>
<packaging>war</packaging>
<parent> <parent>
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<artifactId>parent-boot-2</artifactId> <artifactId>parent-boot-2</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-boot-2</relativePath> <relativePath>../parent-boot-2</relativePath>
</parent> </parent>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId> <artifactId>spring-context</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId> <artifactId>spring-boot-starter-cache</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId> <artifactId>spring-web</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId> <artifactId>spring-webmvc</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.ehcache</groupId> <groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId> <artifactId>ehcache</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId> <artifactId>spring-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.github.ben-manes.caffeine</groupId> <groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId> <artifactId>caffeine</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.h2database</groupId> <groupId>com.h2database</groupId>
<artifactId>h2</artifactId> <artifactId>h2</artifactId>
<scope>runtime</scope> <scope>runtime</scope>
@ -57,10 +58,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId> <artifactId>spring-boot-starter-jdbc</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
<properties>
<ehcache.version>3.5.2</ehcache.version>
</properties>
<properties>
<ehcache.version>3.5.2</ehcache.version>
</properties>
</project> </project>

View File

@ -2,8 +2,6 @@ spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa spring.datasource.username=sa
spring.datasource.password= spring.datasource.password=
#spring.h2.console.enabled=false
# Enabling H2 Console # Enabling H2 Console
spring.h2.console.enabled=true spring.h2.console.enabled=true

View File

@ -32,7 +32,7 @@ public class MultipleCacheManagerIntegrationUnitTest {
private CacheManager alternateCacheManager; private CacheManager alternateCacheManager;
@Test @Test
public void whenCallGetOrderDetail_thenDataShouldBeInCaffieneCacheManager() { public void givenCacheResolverIsConfigured_whenCallGetOrderDetail_thenDataShouldBeInCaffieneCacheManager() {
Integer key = 30001; Integer key = 30001;
cacheManager.getCache("orders") cacheManager.getCache("orders")
.evict(key); .evict(key);
@ -50,7 +50,7 @@ public class MultipleCacheManagerIntegrationUnitTest {
} }
@Test @Test
public void whenCallGetOrderPrice_thenDataShouldBeInAlternateCacheManager() { public void givenCacheResolverIsConfigured_whenCallGetOrderPrice_thenDataShouldBeInAlternateCacheManager() {
Integer key = 30001; Integer key = 30001;
alternateCacheManager.getCache("orderprice") alternateCacheManager.getCache("orderprice")
.evict(key); .evict(key);