From f99e13e50771e3daa3b11ba0a7c05b12f15a1282 Mon Sep 17 00:00:00 2001 From: Junho Hwang <72647031+juno-junho@users.noreply.github.com> Date: Tue, 16 Apr 2024 06:06:31 -0700 Subject: [PATCH] Update ProfileController.java --- .../java/com/spaceclub/global/profile/ProfileController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/spaceclub/global/profile/ProfileController.java b/src/main/java/com/spaceclub/global/profile/ProfileController.java index 7c332bd1..973b47f3 100644 --- a/src/main/java/com/spaceclub/global/profile/ProfileController.java +++ b/src/main/java/com/spaceclub/global/profile/ProfileController.java @@ -7,17 +7,21 @@ import org.springframework.web.bind.annotation.RestController; import java.util.Arrays; +import java.util.List; @RestController @RequiredArgsConstructor @RequestMapping("/api") public class ProfileController { + private static final List BLUE_GREEN = List.of("blue", "green"); + private final Environment env; @GetMapping("/profile") public String profile() { return Arrays.stream(env.getActiveProfiles()) + .filter(BLUE_GREEN::contains) .findAny() .orElseGet(() -> " "); }