Merge branch 'master' into master

This commit is contained in:
Loredana Crusoveanu
2019-11-02 23:34:32 +02:00
committed by GitHub
141 changed files with 995 additions and 687 deletions
@@ -26,11 +26,6 @@
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
@@ -17,14 +17,17 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>${spring-boot.version}</version>
<exclusions>
<exclusion>
<groupId>com.zaxxer</groupId>
@@ -35,6 +38,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
@@ -99,6 +103,7 @@
<validation-api.version>2.0.1.Final</validation-api.version>
<derby.version>10.13.1.1</derby.version>
<hsqldb.version>2.3.4</hsqldb.version>
<spring-boot.version>2.1.7.RELEASE</spring-boot.version>
</properties>
</project>
@@ -87,7 +87,8 @@
<version>${maven-surefire-plugin.version}</version>
<configuration>
<verbose>true</verbose>
<fork>true</fork>
<fork>false</fork>
<forkCount>0</forkCount>
<argLine>-Xmx1024m</argLine>
</configuration>
</plugin>
@@ -38,7 +38,7 @@ public class RedisKeyCommandsIntegrationTest {
@BeforeClass
public static void startRedisServer() throws IOException {
redisServer = new RedisServerBuilder().port(6379).setting("maxheap 256M").build();
redisServer = new RedisServerBuilder().port(6379).setting("maxmemory 256M").build();
redisServer.start();
}
@@ -36,7 +36,7 @@ public class RedisTemplateListOpsIntegrationTest {
@BeforeClass
public static void startRedisServer() throws IOException {
redisServer = new RedisServerBuilder().port(6379).setting("maxheap 128M").build();
redisServer = new RedisServerBuilder().port(6379).setting("maxmemory 128M").build();
redisServer.start();
}
@@ -38,7 +38,7 @@ public class RedisTemplateValueOpsIntegrationTest {
@BeforeClass
public static void startRedisServer() throws IOException {
redisServer = new RedisServerBuilder().port(6379).setting("maxheap 256M").build();
redisServer = new RedisServerBuilder().port(6379).setting("maxmemory 256M").build();
redisServer.start();
}
@@ -33,7 +33,7 @@ public class RedisMessageListenerIntegrationTest {
@BeforeClass
public static void startRedisServer() throws IOException {
redisServer = new RedisServerBuilder().port(6379).setting("maxheap 256M").build();
redisServer = new RedisServerBuilder().port(6379).setting("maxmemory 256M").build();
redisServer.start();
}
@@ -46,7 +46,7 @@ public class RedisMessageListenerIntegrationTest {
public void testOnMessage() throws Exception {
String message = "Message " + UUID.randomUUID();
redisMessagePublisher.publish(message);
Thread.sleep(100);
Thread.sleep(1000);
assertTrue(RedisMessageSubscriber.messageList.get(0).contains(message));
}
}
@@ -34,7 +34,7 @@ public class StudentRepositoryIntegrationTest {
@BeforeClass
public static void startRedisServer() throws IOException {
redisServer = new RedisServerBuilder().port(6379).setting("maxheap 128M").build();
redisServer = new RedisServerBuilder().port(6379).setting("maxmemory 128M").build();
redisServer.start();
}
@@ -1,16 +1,35 @@
package org.baeldung;
import com.baeldung.spring.data.redis.config.RedisConfig;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import redis.embedded.RedisServerBuilder;
import com.baeldung.spring.data.redis.config.RedisConfig;
import static org.springframework.test.annotation.DirtiesContext.ClassMode.BEFORE_CLASS;
@RunWith(SpringJUnit4ClassRunner.class)
@DirtiesContext(classMode = BEFORE_CLASS)
@ContextConfiguration(classes = RedisConfig.class)
public class SpringContextIntegrationTest {
private static redis.embedded.RedisServer redisServer;
@BeforeClass
public static void startRedisServer() {
redisServer = new RedisServerBuilder().port(6379).setting("maxmemory 256M").build();
redisServer.start();
}
@AfterClass
public static void stopRedisServer() {
redisServer.stop();
}
@Test
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
}