@Test
public void overridePidFileWithSpring() throws Exception {
File file = this.temporaryFolder.newFile();
ConfigurableEnvironment environment = new StandardEnvironment();
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);