Skip to content

Commit 7034738

Browse files
authored
Merge pull request #85 from SURFnet/feature/poll-config
Move poll config
2 parents 4e14e1f + 0af1cd6 commit 7034738

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

server/src/main/java/broker/api/BrokerController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ public BrokerController(@Value("${config.broker_client_url}") String clientUrl,
7777
@Value("${config.local}") boolean local,
7878
@Value("${config.allow_playground}") boolean allowPlayground,
7979
@Value("${config.poll_enabled}") boolean pollEnabled,
80+
@Value("${config.poll_survey}") URI pollSurvey,
8081
@Value("${config.play_home_institution_schacHome}") String playHomeInstitutionSchacHome,
8182
@Value("${config.play_guest_institution_schacHome}") String playGuestInstitutionSchacHome,
8283
@Value("${config.play_offering_id}") String playOfferingID,
8384
@Value("${config.catalog_url}") String catalogUrl,
8485
@Value("${config.connection_timeout_millis}") int connectionTimeoutMillis,
8586
@Value("${config.edu_hub.gateway_url}") URI eduHubGatewayUrl,
86-
@Value("${config.edu_hub.poll_survey}") URI pollSurvey,
8787
@Value("${config.edu_hub.user}") String eduHubUser,
8888
@Value("${config.edu_hub.password}") String eduHubPassword,
8989
InstitutionRegistry institutionRegistry,

server/src/main/java/broker/mail/MailBox.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ public class MailBox {
1818

1919
private final JavaMailSender mailSender;
2020
private final String emailFrom;
21-
private final String contactEmail;
21+
private final String pollEmail;
2222
private final String environment;
2323

2424
private final MustacheFactory mustacheFactory = new DefaultMustacheFactory("templates");
2525

2626
public MailBox(JavaMailSender mailSender,
2727
String emailFrom,
28-
String contactEmail,
28+
String pollEmail,
2929
String environment) {
3030
this.mailSender = mailSender;
3131
this.emailFrom = emailFrom;
32-
this.contactEmail = contactEmail;
32+
this.pollEmail = pollEmail;
3333
this.environment = environment;
3434
}
3535

@@ -40,7 +40,7 @@ public void sendPollMail(PollRequest pollRequest) {
4040
variables.put("environment", environment);
4141
}
4242
variables.put("pollRequest", pollRequest);
43-
sendMail("poll_en", "Poll result", variables, contactEmail);
43+
sendMail("poll_en", "Poll result", variables, pollEmail);
4444
}
4545

4646
@SneakyThrows

server/src/main/java/broker/mail/MailConf.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ public class MailConf {
1212

1313
@Bean
1414
public MailBox mailBox(@Value("${email.from}") String emailFrom,
15-
@Value("${email.contactEmail}") String contactEmail,
15+
@Value("${config.poll_email}") String pollEmail,
1616
@Value("${email.environment}") String env,
1717
JavaMailSender mailSender) throws IOException {
18-
return new MailBox(mailSender, emailFrom, contactEmail, env);
18+
return new MailBox(mailSender, emailFrom, pollEmail, env);
1919
}
2020

2121

server/src/main/resources/application.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ datasource:
4040

4141
email:
4242
from: "no-reply@surf.nl"
43-
contactEmail: "support@surf.nl"
4443
environment: "local"
4544

4645
config:
@@ -52,6 +51,8 @@ config:
5251
allow_playground: True
5352
# Do we ask the user to submit a poll response
5453
poll_enabled: True
54+
poll_survey: "https://surf.yellenge.nl/nogiets"
55+
poll_email: "support@surf.nl"
5556
# Default home institution if playground is enabled
5657
play_home_institution_schacHome: "utrecht.nl"
5758
# Default guest institution if playground is enabled
@@ -71,7 +72,6 @@ config:
7172
secret: secret
7273
edu_hub:
7374
gateway_url: http://localhost:8081
74-
poll_survey: "https://surf.yellenge.nl/nogiets"
7575
user: eduhub
7676
password: secret
7777
queueit:

server/src/test/java/broker/api/BrokerControllerUnitTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ public class BrokerControllerUnitTest {
3333
false,
3434
false,
3535
true,
36+
new URI("http://localhost/poll"),
3637
"utrecht.nl",
3738
"eindhoven.nl",
3839
"1",
3940
"https://educhange.nl/",
4041
20_000,
4142
new URI("https://eduhub.nl"),
42-
new URI("https://eduhub.nl"),
4343
"eduhub",
4444
"secret",
4545
new InMemoryInstitutionRegistry(new ClassPathResource("service-registry-test.yml")),

0 commit comments

Comments
 (0)