Skip to content

Commit

Permalink
Testcase fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mercyblitz committed Jun 1, 2024
1 parent b5b29a7 commit 2951684
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.PropertySource;

/**
* I18n Bootstrap
*
* @author <a href="mailto:[email protected]">Mercy</a>
* @since TODO
* @since 1.0.0
*/
@EnableAutoConfiguration
@PropertySource(value = "classpath:/i18n-bootstrap.properties")
public class I18nBootstrap {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
import org.assertj.core.util.Sets;
import org.hamcrest.MatcherAssert;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.context.environment.EnvironmentChangeEvent;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.MapPropertySource;

Expand All @@ -26,7 +28,13 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.equalTo;

@SpringBootTest(classes = MessageSourceIntegrationTest.Config.class)
@SpringBootTest(
classes = MessageSourceIntegrationTest.Config.class,
properties = {
"management.endpoint.i18n.enabled=true" ,
"management.endpoints.web.exposure.include=*"
}
)
class MessageSourceIntegrationTest {

@Test
Expand All @@ -51,14 +59,11 @@ void shouldGetMessageWhenChangeMessageSourceProperty(ApplicationContext applicat

@ImportAutoConfiguration(classes = {
I18nAutoConfiguration.class,
I18nEndpointAutoConfiguration.class
I18nEndpointAutoConfiguration.class,
PropertyPlaceholderAutoConfiguration.class
})
@Import(value = {ReloadableResourceServiceMessageSourceListener.class})
static class Config {

@Bean
ReloadableResourceServiceMessageSourceListener reloadableResourceServiceMessageSourceListener() {
return new ReloadableResourceServiceMessageSourceListener();
}

}
}

0 comments on commit 2951684

Please sign in to comment.