File tree Expand file tree Collapse file tree
src/main/java/com/vimaltech/contactapi/service/impl Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import com .vimaltech .contactapi .dto .EmailRequest ;
44import com .vimaltech .contactapi .service .EmailService ;
55import lombok .extern .slf4j .Slf4j ;
6- import org .springframework .context .annotation .Primary ;
6+ import org .springframework .context .annotation .Profile ;
77import org .springframework .stereotype .Service ;
88
99@ Service
10- @ Primary
10+ @ Profile ( "test" )
1111@ Slf4j
1212public class NoOpEmailService implements EmailService {
1313
Original file line number Diff line number Diff line change 55import lombok .extern .slf4j .Slf4j ;
66import org .springframework .beans .factory .annotation .Value ;
77import org .springframework .boot .autoconfigure .condition .ConditionalOnProperty ;
8+ import org .springframework .context .annotation .Profile ;
89import org .springframework .mail .SimpleMailMessage ;
910import org .springframework .mail .javamail .JavaMailSender ;
1011import org .springframework .scheduling .annotation .Async ;
1112import org .springframework .stereotype .Service ;
1213
1314@ Service
15+ @ Profile ("prod" )
1416@ Slf4j
1517@ ConditionalOnProperty (name = "spring.mail.host" )
1618public class SmtpEmailService implements EmailService {
You can’t perform that action at this time.
0 commit comments