@@ -36,20 +36,20 @@ public class MailServiceImplTest {
3636
3737 @ Mock private Transport transport ;
3838 @ Mock private Session session ;
39- @ Mock private SystemEnvironmentProvider envProvider ;
39+ @ Mock private EnvironmentProvider envProvider ;
4040
4141 private MailServiceImpl mailService ;
4242
4343 @ Before
4444 public void setUp () {
4545 mailService = new MailServiceImpl (envProvider );
4646 // Mock environment variables
47- when (envProvider .getenv ("USE_SMTP_MAIL_SERVICE " )).thenReturn ("true" );
48- when (envProvider .getenv ("SMTP_HOST " )).thenReturn ("smtp.example.com" );
49- when (envProvider .getenv ("SMTP_PORT " )).thenReturn ("587" );
50- when (envProvider .getenv ("SMTP_USER " )).thenReturn ("user" );
51- when (envProvider .getenv ("SMTP_PASSWORD " )).thenReturn ("password" );
52- when (envProvider .getenv ("SMTP_USE_TLS " )).thenReturn ("true" );
47+ when (envProvider .getenv ("APPENGINE_USE_SMTP_MAIL_SERVICE " )).thenReturn ("true" );
48+ when (envProvider .getenv ("APPENGINE_SMTP_HOST " )).thenReturn ("smtp.example.com" );
49+ when (envProvider .getenv ("APPENGINE_SMTP_PORT " )).thenReturn ("587" );
50+ when (envProvider .getenv ("APPENGINE_SMTP_USER " )).thenReturn ("user" );
51+ when (envProvider .getenv ("APPENGINE_SMTP_PASSWORD " )).thenReturn ("password" );
52+ when (envProvider .getenv ("APPENGINE_SMTP_USE_TLS " )).thenReturn ("true" );
5353 }
5454
5555 @ Test
@@ -507,7 +507,7 @@ public void testSendSmtp_customHeaders() throws IOException, MessagingException
507507 @ Test
508508 public void testSendSmtp_disabledTls () throws IOException , MessagingException {
509509 // Setup
510- when (envProvider .getenv ("SMTP_USE_TLS " )).thenReturn ("false" );
510+ when (envProvider .getenv ("APPENGINE_SMTP_USE_TLS " )).thenReturn ("false" );
511511 try (MockedStatic <Session > mockedSession = mockStatic (Session .class )) {
512512 ArgumentCaptor <Properties > propsCaptor = ArgumentCaptor .forClass (Properties .class );
513513 mockedSession
@@ -534,7 +534,7 @@ public void testSendSmtp_disabledTls() throws IOException, MessagingException {
534534 @ Test
535535 public void testSendSmtp_adminEmail () throws IOException , MessagingException {
536536 // Setup
537- when (envProvider .getenv ("ADMIN_EMAIL_RECIPIENTS " ))
537+ when (envProvider .getenv ("APPENGINE_ADMIN_EMAIL_RECIPIENTS " ))
538538 .thenReturn ("admin1@example.com,admin2@example.com" );
539539 try (MockedStatic <Session > mockedSession = mockStatic (Session .class )) {
540540 mockedSession .when (() -> Session .getInstance (any (Properties .class ), any ())).thenReturn (session );
@@ -570,7 +570,7 @@ public void testSendSmtp_adminEmail() throws IOException, MessagingException {
570570 @ Test (expected = IllegalArgumentException .class )
571571 public void testSendSmtp_adminEmailNoRecipients () throws IOException , MessagingException {
572572 // Setup
573- when (envProvider .getenv ("ADMIN_EMAIL_RECIPIENTS " )).thenReturn (null );
573+ when (envProvider .getenv ("APPENGINE_ADMIN_EMAIL_RECIPIENTS " )).thenReturn (null );
574574
575575 // Create a simple message
576576 MailService .Message message = new MailService .Message ();
@@ -627,7 +627,7 @@ public void testSendSmtp_connectionFailure() throws IOException, MessagingExcept
627627 @ Test (expected = IllegalArgumentException .class )
628628 public void testSendSmtp_missingSmtpHost () throws IOException , MessagingException {
629629 // Setup
630- when (envProvider .getenv ("SMTP_HOST " )).thenReturn (null );
630+ when (envProvider .getenv ("APPENGINE_SMTP_HOST " )).thenReturn (null );
631631
632632 // Create a simple message
633633 MailService .Message message = new MailService .Message ();
0 commit comments