Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from ralf-ueberfuhr-ars/features/profiles
Browse files Browse the repository at this point in the history
introduce profiles
  • Loading branch information
ralf-ueberfuhr-ars authored Dec 21, 2023
2 parents a33cd96 + b56ba8b commit 71e954d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package de.sample.schulung.spring.blog.domain;

import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Profile;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
@Profile("!no-initialization")
public class BlogPostInitializer {

private final BlogPostService service;
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application-default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Einstellungen, falls KEIN (anderes) Profil aktiviert ist
3 changes: 3 additions & 0 deletions src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
logging:
level:
de.sample.schulung.spring.blog.domain.BlogPostEventLogger: debug
3 changes: 0 additions & 3 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
server:
port: ${SERVER_PORT:9080}
logging:
level:
de.sample.schulung.spring.blog.domain.BlogPostEventLogger: debug
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.servlet.MockMvc;

import static org.assertj.core.api.Assertions.assertThat;
Expand All @@ -15,6 +16,7 @@

@SpringBootTest
@AutoConfigureMockMvc
@ActiveProfiles("no-initialization")
class BlogPostApiTests {

@Autowired
Expand Down

0 comments on commit 71e954d

Please sign in to comment.