Examples of ApplicationPreparedEvent


Examples of org.springframework.boot.context.event.ApplicationPreparedEvent

    MockPropertySource propertySource = new MockPropertySource();
    propertySource.setProperty("spring.pidfile", file.getAbsolutePath());
    environment.getPropertySources().addLast(propertySource);
    ConfigurableApplicationContext context = mock(ConfigurableApplicationContext.class);
    given(context.getEnvironment()).willReturn(environment);
    ApplicationPreparedEvent event = new ApplicationPreparedEvent(
        new SpringApplication(), new String[] {}, context);
    ApplicationPidFileWriter listener = new ApplicationPidFileWriter();
    listener.onApplicationEvent(event);
    assertThat(FileCopyUtils.copyToString(new FileReader(file)), not(isEmptyString()));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.