package org.gbif.registry;

import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;

@TestConfiguration
@EnableAutoConfiguration
@ComponentScan(basePackages = {"org.gbif.ws.server.interceptor",
    "org.gbif.ws.server.filter", "org.gbif.ws.security", "org.gbif.query", "org.gbif.registry"})
@PropertySource("classpath:application-test.yml")
public class RegistryIntegrationTestsConfiguration {
}

@@ -36,66 +36,239 @@
 org.
-springframework.boot.autoconfigure.EnableAutoConfiguration
+gbif.registry.mail.EmailSender;%0Aimport org.gbif.registry.mail.InMemoryEmailSender;%0Aimport org.springframework.boot.autoconfigure.EnableAutoConfiguration;%0Aimport org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
 ;%0Aim
@@ -321,32 +321,84 @@
 tConfiguration;%0A
+import org.springframework.context.annotation.Bean;%0A
 import org.sprin
@@ -614,18 +614,16 @@
 eptor%22,%0A
-  
   %22org.g
@@ -811,11 +811,233 @@
 ration %7B
+%0A%0A  // use InMemoryEmailSender if devemail is disabled%0A  @Bean%0A  @ConditionalOnProperty(value = %22mail.devemail.enabled%22, havingValue = %22false%22)%0A  public EmailSender emailSender() %7B%0A    return new InMemoryEmailSender();%0A  %7D
 %0A%7D%0A

Add condition on EmailSender bean creation