feat: admin guest, invite email, check-in and attendance endpoints
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
1 parent
4e938bb6a9
commit
87dfc48632
19 files changed
+1361
-7
No files matched your search
+41
@@ -0,0 +1,41 @@
|
||||
package com.solvway.mobile.api.config;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.env.YamlPropertySourceLoader;
|
||||
import org.springframework.core.env.MutablePropertySources;
|
||||
import org.springframework.core.env.PropertySource;
|
||||
import org.springframework.core.env.StandardEnvironment;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
|
||||
/** ADMIN_PORTAL_BASE_URL has a default in the local profile only. */
|
||||
class AdminPortalBaseUrlSettingTest {
|
||||
|
||||
private static StandardEnvironment env(String... files) throws IOException {
|
||||
StandardEnvironment env = new StandardEnvironment();
|
||||
MutablePropertySources sources = env.getPropertySources();
|
||||
for (String f : files) {
|
||||
List<PropertySource<?>> loaded = new YamlPropertySourceLoader().load(f, new ClassPathResource(f));
|
||||
// later files override earlier ones, as an active profile does
|
||||
loaded.forEach(sources::addFirst);
|
||||
}
|
||||
return env;
|
||||
}
|
||||
|
||||
@Test
|
||||
void localProfileDefaultsToLocalhost3001() throws IOException {
|
||||
assertThat(env("application.yml", "application-local.yml").resolveRequiredPlaceholders("${app.admin-portal-base-url}"))
|
||||
.isEqualTo("http://localhost:3001");
|
||||
}
|
||||
|
||||
@Test
|
||||
void otherProfilesHaveNoDefault() throws IOException {
|
||||
StandardEnvironment env = env("application.yml");
|
||||
assertThatThrownBy(() -> env.resolveRequiredPlaceholders("${app.admin-portal-base-url}")).isInstanceOf(IllegalArgumentException.class);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user