### Question:
SpringFacesIntegration extends WebApplicationObjectSupport implements
		ApplicationListener<ContextRefreshedEvent> { public static Date getLastRefreshedDate(ServletContext servletContext) { Assert.notNull(servletContext, "ServletContext must not be null"); return getLastRefreshedDate(servletContext.getAttribute(LAST_REFRESHED_DATE_ATTRIBUTE)); }  void onApplicationEvent(ContextRefreshedEvent event); static boolean isInstalled(ServletContext servletContext); static boolean isInstalled(ExternalContext externalContext); static Date getLastRefreshedDate(ServletContext servletContext); static Date getLastRefreshedDate(ExternalContext externalContext); static SpringFacesIntegration getCurrentInstance(ServletContext servletContext); static SpringFacesIntegration getCurrentInstance(ExternalContext externalContext); static void postConstructApplicationEvent(ExternalContext externalContext, Application application);  }### Answer:
@Test public void shouldThrowWithoutLastRefreshedDate() throws Exception { this.thrown.expect(IllegalStateException.class); this.thrown.expectMessage("Unable to determine the last refresh date for SpringFaces"); SpringFacesIntegration.getLastRefreshedDate(this.servletContext); }
@Test public void shouldThrowWithoutLastRefreshedDateFromExternalContext() throws Exception { this.thrown.expect(IllegalStateException.class); this.thrown.expectMessage("Unable to determine the last refresh date for SpringFaces"); SpringFacesIntegration.getLastRefreshedDate(this.externalContext); }
@Test public void shouldHaveSetLastRefreshedDateOnLoad() throws Exception { createSpringFacesIntegration(); assertThat(SpringFacesIntegration.getLastRefreshedDate(this.servletContext), is(not(nullValue()))); assertThat(SpringFacesIntegration.getLastRefreshedDate(this.externalContext), is(not(nullValue()))); }