### Question:
AdapterDeploymentContextFactoryBean implements FactoryBean<AdapterDeploymentContext>, InitializingBean { @Override public void afterPropertiesSet() throws Exception { if (keycloakConfigResolver != null) { adapterDeploymentContext = new AdapterDeploymentContext(keycloakConfigResolver); } else { log.info("Loading Keycloak deployment from configuration file: {}", keycloakConfigFileResource); KeycloakDeployment deployment = loadKeycloakDeployment(); adapterDeploymentContext = new AdapterDeploymentContext(deployment); } } AdapterDeploymentContextFactoryBean(Resource keycloakConfigFileResource);  AdapterDeploymentContextFactoryBean(KeycloakConfigResolver keycloakConfigResolver); @Override Class<?> getObjectType(); @Override boolean isSingleton(); @Override void afterPropertiesSet(); @Override AdapterDeploymentContext getObject();  }### Answer:
@Test public void should_throw_exception_when_configuration_file_was_not_found() throws Exception { adapterDeploymentContextFactoryBean = new AdapterDeploymentContextFactoryBean(getEmptyResource()); expectedException.expect(FileNotFoundException.class); expectedException.expectMessage("Unable to locate Keycloak configuration file: no-file.json"); adapterDeploymentContextFactoryBean.afterPropertiesSet(); }