Skip to content

Commit fbb1613

Browse files
committed
Added Redis service to docker-compose, updated application properties, and modified JUnit5ExampleTest11 for cleanup operations
1 parent 2970e00 commit fbb1613

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

docker-compose.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ services:
1818
volumes:
1919
- postgresql-data:/var/lib/postgresql/data
2020

21+
redis:
22+
networks:
23+
- tsvi_network
24+
container_name: redis_container
25+
image: redis:latest
26+
restart: on-failure
27+
ports:
28+
- "6379:6379"
29+
2130
app:
2231
networks:
2332
- tsvi_network
@@ -29,12 +38,15 @@ services:
2938
container_name: spring_app_container
3039
depends_on:
3140
- database
41+
- redis
3242
restart: on-failure
3343
environment:
3444
- USER_NAME=postgres
3545
- DB_URL=jdbc:postgresql://database:5432/postgres
3646
- PASSWORD=postgres
3747
- CHANGELOG_VERSION=changelog_version-3.3.xml
48+
- REDIS_HOST=redis
49+
- REDIS_PORT=6379
3850

3951
volumes:
40-
postgresql-data:
52+
postgresql-data:

src/main/resources/application.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
1313
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
1414
spring.redis.host=localhost
1515
spring.redis.port=6379
16-
enableSearchFeature=false
16+
enableSearchFeature=true

src/test/java/net/codejava/JUnit5ExampleTest11.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ void testInsert() {
3535
@Test
3636
void testEnableSearchFeature() {
3737
// print a comment about the value of enableSearchFeature
38-
System.out.println("Expected value of enableSearchFeature: false");
38+
System.out.println("Expected value of enableSearchFeature: true");
3939
System.out.println("Actual value of enableSearchFeature: " + appController.getEnableSearchFeature());
4040

4141
// assert that the value of enableSearchFeature is true
42-
assertEquals(false, appController.getEnableSearchFeature());
42+
assertEquals(true, appController.getEnableSearchFeature());
4343

4444
System.out.println("\n\nTest11-2 Successful!\n\n");
4545
}

0 commit comments

Comments
 (0)