我正在尝试在我的应用程序中运行junit测试。这个项目是由Jhipster创建的,并且是Spring 1.4。该应用程序在正常的开发环境中运行良好,但是当我尝试在测试模式下运行时却没有。 这是我的junit类:
@RunWith(SpringRunner.class)
@SpringBootTest(classes = EasyscheduleApp.class)
public class ProfesorResourceIntTest {
private static final String DEFAULT_NOMBRE = "AAAAA";
private static final String UPDATED_NOMBRE = "BBBBB";
private static final String DEFAULT_PRIMER_APELLIDO = "AAAAA";
private static final String UPDATED_PRIMER_APELLIDO = "BBBBB";
private static final String DEFAULT_SEGUNDO_APELLIDO = "AAAAAA";
private static final String UPDATED_SEGUNDO_APELLIDO = "BBBBBB";
private static final Integer DEFAULT_COD_PROFESOR = 3;
private static final Integer UPDATED_COD_PROFESOR = 2;
private static final String DEFAULT_EMAIL = "AAAAAA";
private static final String UPDATED_EMAIL = "BBBBBB";
private static final String DEFAULT_CATEGORIA = "AAAAAA";
private static final String UPDATED_CATEGORIA = "BBBBBB";
private static final Integer DEFAULT_NUM_CREDITOS_IMPARTIR = 1;
private static final Integer UPDATED_NUM_CREDITOS_IMPARTIR = 2;
private static final Integer DEFAULT_PRIORIDAD = 2;
private static final Integer UPDATED_PRIORIDAD = 1;
private static final String DEFAULT_LOGIN = "CCCCC";
private static final String UPDATED_LOGIN = "FFFFFF";
private static final String DEFAULT_USU_ALTA = "AAAAAA";
private static final String UPDATED_USU_ALTA = "BBBBBBB";
@Autowired
private ProfesorRepository profesorRepository;
@Autowired
private AsignaturaRepository asignaturaRepository;
@Autowired
private MappingJackson2HttpMessageConverter jacksonMessageConverter;
@Autowired
private PageableHandlerMethodArgumentResolver pageableArgumentResolver;
@Autowired
private ExceptionTranslator exceptionTranslator;
@Autowired
private EntityManager em;
private MockMvc restProfesorMockMvc;
private Profesor profesor;
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
ProfesorResource profesorResource = new ProfesorResource(profesorRepository, asignaturaRepository);
this.restProfesorMockMvc = MockMvcBuilders.standaloneSetup(profesorResource)
.setCustomArgumentResolvers(pageableArgumentResolver)
.setControllerAdvice(exceptionTranslator)
.setMessageConverters(jacksonMessageConverter).build();
}
/**
* Create an entity for this test.
*
* This is a static method, as tests for other entities might also need it,
* if they test an entity which requires the current entity.
*/
public static Profesor createEntity(EntityManager em) {
Profesor profesor = new Profesor()
.nombre(DEFAULT_NOMBRE)
.primerApellido(DEFAULT_PRIMER_APELLIDO)
.segundoApellido(DEFAULT_SEGUNDO_APELLIDO)
.codProfesor(DEFAULT_COD_PROFESOR)
.email(DEFAULT_EMAIL)
.categoria(DEFAULT_CATEGORIA)
.numCreditosImpartir(DEFAULT_NUM_CREDITOS_IMPARTIR)
.prioridad(DEFAULT_PRIORIDAD)
.usuAlta(DEFAULT_USU_ALTA)
.login(DEFAULT_LOGIN);
return profesor;
}
@Before
public void initTest() {
profesor = createEntity(em);
}
@Test
@Transactional
public void createProfesor() throws Exception {
int databaseSizeBeforeCreate = profesorRepository.findAll().size();
// Create the Profesor
restProfesorMockMvc.perform(post("/api/profesors")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(profesor)))
.andExpect(status().isCreated());
// Validate the Profesor in the database
List<Profesor> profesorList = profesorRepository.findAll();
assertThat(profesorList).hasSize(databaseSizeBeforeCreate + 1);
Profesor testProfesor = profesorList.get(profesorList.size() - 1);
assertThat(testProfesor.getNombre()).isEqualTo(DEFAULT_NOMBRE);
assertThat(testProfesor.getPrimerApellido()).isEqualTo(DEFAULT_PRIMER_APELLIDO);
assertThat(testProfesor.getSegundoApellido()).isEqualTo(DEFAULT_SEGUNDO_APELLIDO);
assertThat(testProfesor.getCodProfesor()).isEqualTo(DEFAULT_COD_PROFESOR);
assertThat(testProfesor.getEmail()).isEqualTo(DEFAULT_EMAIL);
assertThat(testProfesor.getCategoria()).isEqualTo(DEFAULT_CATEGORIA);
assertThat(testProfesor.getNumCreditosImpartir()).isEqualTo(DEFAULT_NUM_CREDITOS_IMPARTIR);
assertThat(testProfesor.getPrioridad()).isEqualTo(DEFAULT_PRIORIDAD);
assertThat(testProfesor.getLogin()).isEqualTo(DEFAULT_LOGIN);
assertThat(testProfesor.getUsuAlta()).isEqualTo(DEFAULT_USU_ALTA);
}
@Test
@Transactional
public void createProfesorWithExistingId() throws Exception {
int databaseSizeBeforeCreate = profesorRepository.findAll().size();
// Create the Profesor with an existing ID
profesor.setId(1L);
// An entity with an existing ID cannot be created, so this API call must fail
restProfesorMockMvc.perform(post("/api/profesors")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(profesor)))
.andExpect(status().isBadRequest());
// Validate the Alice in the database
List<Profesor> profesorList = profesorRepository.findAll();
assertThat(profesorList).hasSize(databaseSizeBeforeCreate);
}
@Test
@Transactional
public void checkNombreIsRequired() throws Exception {
int databaseSizeBeforeTest = profesorRepository.findAll().size();
// set the field null
profesor.setNombre(null);
// Create the Profesor, which fails.
restProfesorMockMvc.perform(post("/api/profesors")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(profesor)))
.andExpect(status().isBadRequest());
List<Profesor> profesorList = profesorRepository.findAll();
assertThat(profesorList).hasSize(databaseSizeBeforeTest);
}
@Test
@Transactional
public void checkPrimerApellidoIsRequired() throws Exception {
int databaseSizeBeforeTest = profesorRepository.findAll().size();
// set the field null
profesor.setPrimerApellido(null);
// Create the Profesor, which fails.
restProfesorMockMvc.perform(post("/api/profesors")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(profesor)))
.andExpect(status().isBadRequest());
List<Profesor> profesorList = profesorRepository.findAll();
assertThat(profesorList).hasSize(databaseSizeBeforeTest);
}
@Test
@Transactional
public void checkSegundoApellidoIsRequired() throws Exception {
int databaseSizeBeforeTest = profesorRepository.findAll().size();
// set the field null
profesor.setSegundoApellido(null);
// Create the Profesor, which fails.
restProfesorMockMvc.perform(post("/api/profesors")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(profesor)))
.andExpect(status().isBadRequest());
List<Profesor> profesorList = profesorRepository.findAll();
assertThat(profesorList).hasSize(databaseSizeBeforeTest);
}
@Test
@Transactional
public void checkCodProfesorIsRequired() throws Exception {
int databaseSizeBeforeTest = profesorRepository.findAll().size();
// set the field null
profesor.setCodProfesor(null);
// Create the Profesor, which fails.
restProfesorMockMvc.perform(post("/api/profesors")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(profesor)))
.andExpect(status().isBadRequest());
List<Profesor> profesorList = profesorRepository.findAll();
assertThat(profesorList).hasSize(databaseSizeBeforeTest);
}
@Test
@Transactional
public void checkEmailIsRequired() throws Exception {
int databaseSizeBeforeTest = profesorRepository.findAll().size();
// set the field null
profesor.setEmail(null);
// Create the Profesor, which fails.
restProfesorMockMvc.perform(post("/api/profesors")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(profesor)))
.andExpect(status().isBadRequest());
List<Profesor> profesorList = profesorRepository.findAll();
assertThat(profesorList).hasSize(databaseSizeBeforeTest);
}
@Test
@Transactional
public void checkCategoriaIsRequired() throws Exception {
int databaseSizeBeforeTest = profesorRepository.findAll().size();
// set the field null
profesor.setCategoria(null);
// Create the Profesor, which fails.
restProfesorMockMvc.perform(post("/api/profesors")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(profesor)))
.andExpect(status().isBadRequest());
List<Profesor> profesorList = profesorRepository.findAll();
assertThat(profesorList).hasSize(databaseSizeBeforeTest);
}
@Test
@Transactional
public void checkPrioridadIsRequired() throws Exception {
int databaseSizeBeforeTest = profesorRepository.findAll().size();
// set the field null
profesor.setPrioridad(null);
// Create the Profesor, which fails.
restProfesorMockMvc.perform(post("/api/profesors")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(profesor)))
.andExpect(status().isBadRequest());
List<Profesor> profesorList = profesorRepository.findAll();
assertThat(profesorList).hasSize(databaseSizeBeforeTest);
}
@Test
@Transactional
public void checkLoginRequired() throws Exception {
int databaseSizeBeforeTest = profesorRepository.findAll().size();
// set the field null
profesor.setLogin(null);
// Create the Profesor, which fails.
restProfesorMockMvc.perform(post("/api/profesors")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(profesor)))
.andExpect(status().isBadRequest());
List<Profesor> profesorList = profesorRepository.findAll();
assertThat(profesorList).hasSize(databaseSizeBeforeTest);
}
@Test
@Transactional
public void checkUsuAltaIsRequired() throws Exception {
int databaseSizeBeforeTest = profesorRepository.findAll().size();
// set the field null
profesor.setUsuAlta(null);
// Create the Profesor, which fails.
restProfesorMockMvc.perform(post("/api/profesors")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(profesor)))
.andExpect(status().isBadRequest());
List<Profesor> profesorList = profesorRepository.findAll();
assertThat(profesorList).hasSize(databaseSizeBeforeTest);
}
@Test
@Transactional
public void getAllProfesors() throws Exception {
// Initialize the database
profesorRepository.saveAndFlush(profesor);
// Get all the profesorList
restProfesorMockMvc.perform(get("/api/profesors?sort=id,desc"))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.[*].id").value(hasItem(profesor.getId().intValue())))
.andExpect(jsonPath("$.[*].nombre").value(hasItem(DEFAULT_NOMBRE.toString())))
.andExpect(jsonPath("$.[*].primerApellido").value(hasItem(DEFAULT_PRIMER_APELLIDO.toString())))
.andExpect(jsonPath("$.[*].segundoApellido").value(hasItem(DEFAULT_SEGUNDO_APELLIDO.toString())))
.andExpect(jsonPath("$.[*].codProfesor").value(hasItem(DEFAULT_COD_PROFESOR)))
.andExpect(jsonPath("$.[*].email").value(hasItem(DEFAULT_EMAIL.toString())))
.andExpect(jsonPath("$.[*].categoria").value(hasItem(DEFAULT_CATEGORIA.toString())))
.andExpect(jsonPath("$.[*].numCreditosImpartir").value(hasItem(DEFAULT_NUM_CREDITOS_IMPARTIR)))
.andExpect(jsonPath("$.[*].prioridad").value(hasItem(DEFAULT_PRIORIDAD)))
.andExpect(jsonPath("$.[*].usuAlta").value(hasItem(DEFAULT_USU_ALTA.toString())))
;
}
@Test
@Transactional
public void getProfesor() throws Exception {
// Initialize the database
profesorRepository.saveAndFlush(profesor);
// Get the profesor
restProfesorMockMvc.perform(get("/api/profesors/{id}", profesor.getId()))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.id").value(profesor.getId().intValue()))
.andExpect(jsonPath("$.nombre").value(DEFAULT_NOMBRE.toString()))
.andExpect(jsonPath("$.primerApellido").value(DEFAULT_PRIMER_APELLIDO.toString()))
.andExpect(jsonPath("$.segundoApellido").value(DEFAULT_SEGUNDO_APELLIDO.toString()))
.andExpect(jsonPath("$.codProfesor").value(DEFAULT_COD_PROFESOR))
.andExpect(jsonPath("$.email").value(DEFAULT_EMAIL.toString()))
.andExpect(jsonPath("$.categoria").value(DEFAULT_CATEGORIA.toString()))
.andExpect(jsonPath("$.numCreditosImpartir").value(DEFAULT_NUM_CREDITOS_IMPARTIR))
.andExpect(jsonPath("$.prioridad").value(DEFAULT_PRIORIDAD))
.andExpect(jsonPath("$.usuAlta").value(DEFAULT_USU_ALTA.toString()))
.andExpect(jsonPath("$.login").value(DEFAULT_LOGIN.toString()));
}
@Test
@Transactional
public void getNonExistingProfesor() throws Exception {
// Get the profesor
restProfesorMockMvc.perform(get("/api/profesors/{id}", Long.MAX_VALUE))
.andExpect(status().isNotFound());
}
@Test
@Transactional
public void updateProfesor() throws Exception {
// Initialize the database
profesorRepository.saveAndFlush(profesor);
int databaseSizeBeforeUpdate = profesorRepository.findAll().size();
// Update the profesor
Profesor updatedProfesor = profesorRepository.findOne(profesor.getId());
updatedProfesor
.nombre(UPDATED_NOMBRE)
.primerApellido(UPDATED_PRIMER_APELLIDO)
.segundoApellido(UPDATED_SEGUNDO_APELLIDO)
.codProfesor(UPDATED_COD_PROFESOR)
.email(UPDATED_EMAIL)
.categoria(UPDATED_CATEGORIA)
.numCreditosImpartir(UPDATED_NUM_CREDITOS_IMPARTIR)
.prioridad(UPDATED_PRIORIDAD)
.usuAlta(UPDATED_USU_ALTA)
.login(UPDATED_LOGIN);
restProfesorMockMvc.perform(put("/api/profesors")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(updatedProfesor)))
.andExpect(status().isOk());
// Validate the Profesor in the database
List<Profesor> profesorList = profesorRepository.findAll();
assertThat(profesorList).hasSize(databaseSizeBeforeUpdate);
Profesor testProfesor = profesorList.get(profesorList.size() - 1);
assertThat(testProfesor.getNombre()).isEqualTo(UPDATED_NOMBRE);
assertThat(testProfesor.getPrimerApellido()).isEqualTo(UPDATED_PRIMER_APELLIDO);
assertThat(testProfesor.getSegundoApellido()).isEqualTo(UPDATED_SEGUNDO_APELLIDO);
assertThat(testProfesor.getCodProfesor()).isEqualTo(UPDATED_COD_PROFESOR);
assertThat(testProfesor.getEmail()).isEqualTo(UPDATED_EMAIL);
assertThat(testProfesor.getCategoria()).isEqualTo(UPDATED_CATEGORIA);
assertThat(testProfesor.getNumCreditosImpartir()).isEqualTo(UPDATED_NUM_CREDITOS_IMPARTIR);
assertThat(testProfesor.getPrioridad()).isEqualTo(UPDATED_PRIORIDAD);
assertThat(testProfesor.getUsuAlta()).isEqualTo(UPDATED_USU_ALTA);
}
@Test
@Transactional
public void updateNonExistingProfesor() throws Exception {
int databaseSizeBeforeUpdate = profesorRepository.findAll().size();
// Create the Profesor
// If the entity doesn't have an ID, it will be created instead of just being updated
restProfesorMockMvc.perform(put("/api/profesors")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(profesor)))
.andExpect(status().isCreated());
// Validate the Profesor in the database
List<Profesor> profesorList = profesorRepository.findAll();
assertThat(profesorList).hasSize(databaseSizeBeforeUpdate + 1);
}
@Test
@Transactional
public void deleteProfesor() throws Exception {
// Initialize the database
profesorRepository.saveAndFlush(profesor);
int databaseSizeBeforeDelete = profesorRepository.findAll().size();
// Get the profesor
restProfesorMockMvc.perform(delete("/api/profesors/{id}", profesor.getId())
.accept(TestUtil.APPLICATION_JSON_UTF8))
.andExpect(status().isOk());
// Validate the database is empty
List<Profesor> profesorList = profesorRepository.findAll();
assertThat(profesorList).hasSize(databaseSizeBeforeDelete - 1);
}
@Test
@Transactional
public void equalsVerifier() throws Exception {
TestUtil.equalsVerifier(Profesor.class);
}
}
-application-dev.yml-
spring:
profiles:
active: dev
include: swagger
devtools:
restart:
enabled: true
livereload:
enabled: false
jackson:
serialization.indent_output: true
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://localhost:3306/easyschedule?useUnicode=true&characterEncoding=utf8&useSSL=false
username: root
password: *
hikari:
data-source-properties:
cachePrepStmts: true
prepStmtCacheSize: 250
prepStmtCacheSqlLimit: 2048
useServerPrepStmts: true
jpa:
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
database: MYSQL
show-sql: true
properties:
hibernate.id.new_generator_mappings: true
hibernate.cache.use_second_level_cache: false
hibernate.cache.use_query_cache: false
hibernate.generate_statistics: true
mail:
host: smtp.gmail.com
port: 587
username: mymail@gmail.com username.
password: *
protocol: smtp
tls: true
properties.mail.smtp:
auth: true
starttls.enable: true
ssl.trust: smtp.gmail.com
messages:
cache-seconds: 1
thymeleaf:
cache: false
liquibase:
contexts: dev
server:
port: 8080
jhipster:
http:
version: V_1_1 # To use HTTP/2 you will need SSL support (see above the "server.ssl" configuration)
security:
remember-me:
key: *******
mail:
from: mymail@gmail.com
base-url: http://127.0.0.1:8080
metrics:
jmx.enabled: true
graphite:
enabled: false
host: localhost
port: 2003
prefix: easyschedule
logging:
logstash:
enabled: false
host: localhost
port: 5000
queue-size: 512
-Application.yml测试-
spring:
application:
name: easyschedule
jackson:
serialization.write_dates_as_timestamps: false
cache:
type: none
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:h2:mem:easyschedule;DB_CLOSE_DELAY=-1
name:
username:
password:
jpa:
database-platform: io.github.jhipster.domain.util.FixedH2Dialect
database: H2
open-in-view: false
show-sql: true
hibernate:
ddl-auto: none
naming:
physical-strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy
implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
properties:
hibernate.id.new_generator_mappings: true
hibernate.cache.use_second_level_cache: false
hibernate.cache.use_query_cache: false
hibernate.generate_statistics: true
hibernate.hbm2ddl.auto: validate
mail:
host: localhost
messages:
basename: i18n/messages
mvc:
favicon:
enabled: false
thymeleaf:
mode: XHTML
liquibase:
contexts: test
security:
basic:
enabled: false
server:
port: 10344
address: localhost
jhipster:
async:
core-pool-size: 2
max-pool-size: 50
queue-capacity: 10000
security:
已编辑的错误跟踪。当我尝试在测试模式下运行时不会。
java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:189)
at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:131)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1081)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:856)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:120)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
... 24 more
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:967)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:892)
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:60)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:353)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:370)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:359)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing column [fecha_seleccion] in table [asignatura_profesor]
at org.hibernate.tool.schema.internal.AbstractSchemaValidator.validateTable(AbstractSchemaValidator.java:136)
at org.hibernate.tool.schema.internal.GroupedSchemaValidatorImpl.validateTables(GroupedSchemaValidatorImpl.java:42)
at org.hibernate.tool.schema.internal.AbstractSchemaValidator.performValidation(AbstractSchemaValidator.java:89)
at org.hibernate.tool.schema.internal.AbstractSchemaValidator.doValidation(AbstractSchemaValidator.java:68)
at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:191)
at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:309)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:445)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:889)