Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "CONTENTSET" not found; SQL statement:
- select contentset0_.contentsetid as contents1_1_, contentset0_.checksum as checksum2_1_, contentset0_.contentsetname as contents3_1_, contentset0_.zipped as zipped4_1_ from contentset contentset0_ [42102-199]
- at org.h2.message.DbException.getJdbcSQLException(DbException.java:451)
- at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
- at org.h2.message.DbException.get(DbException.java:205)
- @Entity
- @Table(name = "contentset")
- public class ContentSet implements Serializable {
- @Id
- @Column(name="CONTENTSETID")
- private String contentSetId;
- @Column(name="CONTENTSETNAME", nullable=false)
- private String contentSetName;
- ......
- public interface ContentSetRepository extends JpaRepository<ContentSet, String> { }
- spring.datasource.url=jdbc:mysql://10.80.100.62:3306/receiver
- spring.datasource.username=xxx
- spring.datasource.password=xxx
- spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
- spring.jpa.database = MYSQL
- spring.jpa.show-sql = true
- spring.jpa.properties.hibernate.format_sql=true
- spring.jpa.hibernate.ddl-auto = none
- spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
- # NOTHING SEEMS TO RESOLVE UPPERCASE TABLE name
- #spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl
- #spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
- @RunWith(SpringRunner.class)
- @DataJpaTest
- @AutoConfigureTestDatabase(replace=AutoConfigureTestDatabase.Replace.AUTO_CONFIGURED)
- @TestPropertySource(locations = "classpath:application.properties")
- public class ContentSetRepositoryMySqlTest {
- @Autowired private ContentSetRepository contentSetRepo;
- @Test
- public void testFindAll_For_ContentSetRepository() {
- Assertions.assertThat(contentSetRepo).isNotNull();
- try {
- Collection<ContentSet> all = contentSetRepo.findAll();
- Assertions.assertThat(all).isNotNull();
- Assertions.assertThat(all.size()).isGreaterThan(0);
- } catch(Exception ex ) {
- ex.printStackTrace();
- Assertions.fail("Exception : " + ex.getMessage());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement