Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated java tests fails when a field has unique validation, entity has filter and is required #15348

Closed
1 task done
CGarces opened this issue Jun 16, 2021 · 1 comment · Fixed by #15466
Closed
1 task done
Milestone

Comments

@CGarces
Copy link
Contributor

CGarces commented Jun 16, 2021

Overview of the issue

Same as #9666 maybe is a regression error

Generated java tests fails when a field has unique validation and filter:

[ERROR] Tests run: 31, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.886 s <<< FAILURE! - in com.test.unique.web.rest.IssueResourceIT
[ERROR] com.test.unique.web.rest.IssueResourceIT.getAllIssuesByPeopleIsEqualToSomething  Time elapsed: 0.016 s  <<< ERROR!
javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
        at com.test.unique.web.rest.IssueResourceIT.getAllIssuesByPeopleIsEqualToSomething(IssueResourceIT.java:385)
Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
        at com.test.unique.web.rest.IssueResourceIT.getAllIssuesByPeopleIsEqualToSomething(IssueResourceIT.java:385)
Caused by: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException:
Reproduce the error

Use the JDL from the issue to generate a new project.

jhipster JDL model.jdl
./mvnw verify
Related issues

#9666

JHipster Version(s)

7.0.1

JHipster configuration
JDL definitions
     application {
  config {
    applicationType monolith
    authenticationType jwt
    baseName uniquetest
    blueprints []
    buildTool maven
    cacheProvider ehcache
    clientFramework angularX
    clientPackageManager npm
    clientTheme litera
    clientThemeVariant light
    creationTimestamp 1616404743781
    databaseType sql
    devDatabaseType h2Disk
    dtoSuffix DTO
    enableHibernateCache true
    enableSwaggerCodegen false
    enableTranslation true
    jhiPrefix jhi
    jhipsterVersion "7.0.1"
    languages [es]
    messageBroker false
    nativeLanguage es
    otherModules []
    packageName com.test.unique
    prodDatabaseType mysql
    reactive false
    searchEngine false
    serverPort 8080
    serviceDiscoveryType false
    skipClient false
    skipServer false
    skipUserManagement false
    testFrameworks []
    websocket false
    withAdminUi true
  }

entities Employer, Issue
}

entity Employer {
email String required unique
name String required
telefono1 String required
telefono2 String
}
entity Issue {
status String required
description String required
}

relationship ManyToOne {
Issue{people(name) required} to Employer
}

service Issue with serviceClass
filter Issue

  • Checking this box is mandatory (this is just to show you read everything)
@qmonmert
Copy link
Contributor

qmonmert commented Jun 27, 2021

@pascalgrimaud I confirm the bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants