jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.54k stars 4.02k forks source link

Single Enum Value Fails Integration Test #12122

Closed RDsideNow closed 1 year ago

RDsideNow commented 4 years ago
Overview of the issue

If a single enum value is present, integration test fails

Motivation for or Use Case

Causes gitlab ci-cd integration tests to fail

Reproduce the error

Import JDL

Run integration tests

Related issues

12076

12091

Suggest a Fix

Not sure if the issue is in the filtering or not

JHipster Version(s)
JHipster configuration

Welcome to the JHipster Information Sub-Generator

JHipster Version(s)
tenant@0.0.0 /Users/Repos/GitLab/jhipster bugs/tenant
└── generator-jhipster@6.10.1 
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "authenticationType": "uaa",
    "cacheProvider": "hazelcast",
    "serverPort": "8083",
    "serviceDiscoveryType": "eureka",
    "skipUserManagement": true,
    "baseName": "tenant",
    "buildTool": "gradle",
    "databaseType": "sql",
    "devDatabaseType": "postgresql",
    "enableHibernateCache": true,
    "enableSwaggerCodegen": true,
    "enableTranslation": true,
    "jhiPrefix": "jhi",
    "languages": ["fr", "es", "en"],
    "messageBroker": "kafka",
    "nativeLanguage": "en",
    "prodDatabaseType": "postgresql",
    "searchEngine": false,
    "skipClient": true,
    "testFrameworks": ["gatling", "cucumber"],
    "websocket": false,
    "applicationType": "microservice",
    "packageName": "com.jhipster.demo.tenant",
    "packageFolder": "com/jhipster/demo/tenant",
    "uaaBaseName": "uaa",
    "clientPackageManager": "yarn",
    "dtoSuffix": "DTO",
    "jhipsterVersion": "6.10.1",
    "creationTimestamp": 1595202960604,
    "embeddableLaunchScript": false,
    "entitySuffix": "",
    "otherModules": [],
    "blueprints": []
  },
  "entities": [
    "Tenant",
    "TenantStatusHistory",
    "TenantAddress",
    "TenantContact",
    "TenantTaxInformation",
    "TenantBankAccount",
    "TenantContactInformation",
    "TenantVendor",
    "TenantVendorStatusHistory",
    "TenantBankFileSpec"
  ]
}

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
entity TenantVendor {
  tenantVendorType TenantVendorType required,
  status VendorTenantStatus required,
  zipcode String required,
  createdBy String,
  createdOn Instant,
  updatedBy String,
  updatedOn Instant
}
entity TenantVendorStatusHistory {
  sequenceNumber Integer required,
  dateTime Instant required,
  status VendorTenantStatus required,
  createdBy String
}
entity Tenant {
  tenantNumber String unique required,
  status TenantStatus required,
  name String required,
  phoneNumber String,
  websiteURL String maxlength(100),
  logo ImageBlob,
  createdBy String,
  createdOn Instant,
  updatedBy String,
  updatedOn Instant
}
entity TenantBankAccount {
  bankName String,
  routingNumber String required pattern(/^[0-9]{9,9}$/),
  accountNumber String required pattern(/^[0-9]{7,14}$/),
  currentCheckNumber String required,
  createdBy String,
  createdOn Instant,
  updatedBy String,
  updatedOn Instant
}
entity TenantBankFileSpec {
  tenantPaymentType TenantPaymentType required,
  fileExportType TenantBankFileExportType required,
  fileType TenantBankFileType required,
  filePathLocation String
}
entity TenantTaxInformation {
  isActive Boolean,
  taxIdentityNumber String unique required pattern(/^(\d{2})-(\d{7})$/),
  taxClass TenantTaxClassType required,
  purchaseDate LocalDate required,
  legalBusinessName String required,
  createdBy String,
  createdOn Instant,
  updatedBy String,
  updatedOn Instant
}
entity TenantContact {
  sequenceNumber Integer required,
  isActive Boolean,
  contactType TenantContactType required,
  firstName String required,
  lastName String,
  createdBy String,
  createdOn Instant,
  updatedBy String,
  updatedOn Instant
}
entity TenantContactInformation {
  contactMethod TenantContactMethodType required,
  emailAddress String,
  businessPhoneNumber String,
  extension String,
  mobilePhoneNumber String,
  homePhoneNumber String,
  faxNumber String,
  createdBy String,
  createdOn Instant,
  updatedBy String,
  updatedOn Instant
}
entity TenantAddress {
  streetAddress String required,
  suiteNumber String,
  city String required,
  stateProvidence String required,
  zipcode String required,
  latitude String,
  longitude String,
  createdBy String,
  createdOn Instant,
  updatedBy String,
  updatedOn Instant
}
entity TenantStatusHistory {
  sequenceNumber Integer required,
  dateTime Instant required,
  status TenantStatus required,
  createdBy String
}
enum TenantVendorType {
  PREFERRED,
  EXCLUDED
}
enum VendorTenantStatus {
  DRAFT,
  SUBMITTED,
  PENDING,
  APPROVED,
  DENIED,
  ACTIVE,
  INACTIVE,
  SUSPENDED,
  VOIDED
}
enum TenantStatus {
  ACTIVE,
  INACTIVE,
  DEACTIVATED,
  SUSPENDED,
  DELETED,
  VOID
}
enum TenantPaymentType {
  CHECK,
  EFT,
  CREDIT_CARD
}
enum TenantBankFileExportType {
  CSV
}
enum TenantBankFileType {
  STANDARD,
  CUSTOM
}
enum TenantTaxClassType {
  INDIVIDUAL_SOLE_PROPRIETER,
  CORPORATION,
  PARTNERSHIP,
  LIMITED_LIABILITY_COMPANY
}
enum TenantContactType {
  TENANT_INVOICING,
  COVERAGE_VERIFICATION
}
enum TenantContactMethodType {
  EMAIL,
  MOBILE_PHONE,
  BUSINESS_PHONE,
  HOME_PHONE,
  FAX
}

relationship OneToOne {
  TenantTaxInformation{tenantContact} to TenantContact,
  TenantTaxInformation{tenantAddress required} to TenantAddress,
  TenantAddress{tenantContact required} to TenantContact
}
relationship OneToMany {
  Tenant{tenantVendor} to TenantVendor{tenant required},
  Tenant{tenantVendorStatusHistory} to TenantVendorStatusHistory{tenant required},
  TenantVendor{tenantVendorStatusHistory} to TenantVendorStatusHistory{tenantVendor required},
  Tenant{tenantBankAccount} to TenantBankAccount{tenant required},
  Tenant{tenantBankFileSpec} to TenantBankFileSpec{tenant required},
  TenantBankAccount{tenantBankFileSpec} to TenantBankFileSpec{tenantBankAccount required},
  Tenant{tenantTaxInformation} to TenantTaxInformation{tenant required},
  Tenant{tenantContact} to TenantContact{tenant required},
  Tenant{tenantContactInformation} to TenantContactInformation{tenant required},
  TenantContact{tenantContactInformation} to TenantContactInformation{tenantContact required},
  Tenant{tenantAddress} to TenantAddress{tenant required},
  Tenant{tenantStatusHistory} to TenantStatusHistory{tenant required}
}

dto TenantVendor, TenantVendorStatusHistory, Tenant, TenantBankAccount, TenantBankFileSpec, TenantTaxInformation, TenantContact, TenantContactInformation, TenantAddress, TenantStatusHistory with mapstruct
paginate TenantVendor, TenantVendorStatusHistory, Tenant, TenantBankAccount, TenantBankFileSpec, TenantTaxInformation, TenantContact, TenantContactInformation, TenantAddress, TenantStatusHistory with pagination
service TenantVendor, TenantVendorStatusHistory, Tenant, TenantBankAccount, TenantBankFileSpec, TenantTaxInformation, TenantContact, TenantContactInformation, TenantAddress, TenantStatusHistory with serviceClass
microservice TenantVendor, TenantVendorStatusHistory, Tenant, TenantBankAccount, TenantBankFileSpec, TenantTaxInformation, TenantContact, TenantContactInformation, TenantAddress, TenantStatusHistory with tenant
filter TenantVendor, TenantVendorStatusHistory, Tenant, TenantBankAccount, TenantBankFileSpec, TenantTaxInformation, TenantContact, TenantContactInformation, TenantAddress, TenantStatusHistory

Environment and Tools

openjdk version "12.0.2" 2019-07-16 OpenJDK Runtime Environment AdoptOpenJDK (build 12.0.2+10) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 12.0.2+10, mixed mode)

git version 2.23.0

node: v14.5.0

npm: 6.14.6

yarn: 1.22.4

Docker version 19.03.8, build afacb8b

docker-compose version 1.25.5, build 8a1c60f6

identical .jhipster/Tenant.json identical .jhipster/TenantAddress.json identical .jhipster/TenantBankAccount.json identical .jhipster/TenantBankFileSpec.json identical .jhipster/TenantContact.json identical .jhipster/TenantContactInformation.json identical .jhipster/TenantStatusHistory.json identical .jhipster/TenantTaxInformation.json identical .jhipster/TenantVendor.json identical .jhipster/TenantVendorStatusHistory.json INFO! Congratulations, JHipster execution is complete!

If you have a JDL please wrap it in below structure

JDL definitions
     application {
  config {
             applicationType uaa,
             baseName uaa,
             packageName com.jhipster.demo.uaa,
             serverPort 9999,
             serviceDiscoveryType eureka,
             authenticationType uaa,
             uaaBaseName "uaa",
             cacheProvider hazelcast,
             enableHibernateCache true,
             jwtSecretKey "M2VmOWQ5MjcyZTJhZDJmODc3NmVjYWJkNzI0MGNjY2IxMDZjNDFiZTU4NDA1OTkyMWIzNjc0OGQwZDIyMjZmNWNlMTNhMDBlNjkyZGM2NjljN2Y0NThiNDE4ZGEzOTE5Njk4M2I3YWU2ZjUzNDY0ZjA1NDg5MjI3NDFhNDA0MTI="
             websocket false,
             databaseType sql,
             messageBroker kafka,
            devDatabaseType postgresql,
            prodDatabaseType postgresql,
             enableSwaggerCodegen true,
             buildTool gradle,
             useSass true,
             clientPackageManager yarn,
             testFrameworks [
               gatling,
               cucumber
             ],
             enableTranslation true,
             nativeLanguage en,
             languages [
               fr,
               es,
               en
             ],
             jhiPrefix jhi,
             dtoSuffix DTO,
             skipClient true,
             skipUserManagement false
         }
}

application {
  config {
        applicationType gateway,
        baseName apigateway,
        packageName com.jhipster.demo.apigateway,
        serverPort 8080,
        serviceDiscoveryType eureka,
        authenticationType uaa,
        uaaBaseName "uaa",
        cacheProvider ehcache,
        enableHibernateCache true,
        websocket spring-websocket,
        databaseType sql,
        devDatabaseType postgresql,
        prodDatabaseType postgresql,
        enableSwaggerCodegen true,
        buildTool gradle,
        useSass true,
        messageBroker kafka,
        clientPackageManager yarn,
        testFrameworks [
          gatling,
          cucumber,
          protractor
        ],
        enableTranslation true,
        nativeLanguage en,
        languages [
          fr,
          es,
          en
        ],
        clientFramework angularX,
        jhiPrefix jhi,
        dtoSuffix DTO
        }
      entities *
}

application {
  config {
             applicationType microservice,
             baseName tenant,
             packageName com.jhipster.demo.tenant,
             serverPort 8083,
             serviceDiscoveryType eureka,
             authenticationType uaa,
             uaaBaseName "uaa",
             cacheProvider hazelcast,
             enableHibernateCache true,
             websocket false,
             databaseType sql,
             messageBroker kafka,
             devDatabaseType postgresql,
             prodDatabaseType postgresql,
             enableSwaggerCodegen true,
             buildTool gradle,
             useSass true,
             clientPackageManager yarn,
             testFrameworks [
               gatling,
               cucumber
             ],
             enableTranslation true,
             nativeLanguage en,
             languages [
               fr,
               es,
               en
             ],
             jhiPrefix jhi,
             dtoSuffix DTO,
             skipClient true,
             skipUserManagement true
         }
  entities Tenant, TenantStatusHistory, TenantAddress, TenantContact,
           TenantTaxInformation, TenantBankAccount, TenantContactInformation,
           TenantVendor, TenantVendorStatusHistory, TenantBankFileSpec
}

relationship OneToOne {
    TenantAddress{tenantContact required} to TenantContact,
    TenantTaxInformation{tenantContact} to TenantContact,
    TenantTaxInformation{tenantAddress required} to TenantAddress
}

relationship OneToMany {
    Tenant{tenantBankFileSpec} to TenantBankFileSpec{tenant required},
    TenantBankAccount{tenantBankFileSpec} to TenantBankFileSpec{tenantBankAccount required},
    Tenant{tenantContactInformation} to TenantContactInformation{tenant required}
    Tenant{tenantVendor} to TenantVendor{tenant required}
    Tenant{tenantVendorStatusHistory} to TenantVendorStatusHistory{tenant required}
    TenantVendor{tenantVendorStatusHistory} to TenantVendorStatusHistory{tenantVendor required}
    Tenant{tenantStatusHistory} to TenantStatusHistory{tenant required}
    Tenant{tenantAddress} to TenantAddress{tenant required},
    Tenant{tenantTaxInformation} to TenantTaxInformation{tenant required},
    TenantContact{tenantContactInformation} to TenantContactInformation{tenantContact required},
    Tenant{tenantContact} to TenantContact{tenant required},
    Tenant{tenantBankAccount} to TenantBankAccount{tenant required}
}

enum TenantVendorType {
    PREFERRED,
    EXCLUDED
}

entity TenantVendor {
    tenantVendorType TenantVendorType required,
    status VendorTenantStatus required,
    zipcode String required
    createdBy String,
    createdOn Instant,
    updatedBy String,
    updatedOn Instant
}

entity TenantVendorStatusHistory {
    sequenceNumber Integer required,
    dateTime Instant required,
    status VendorTenantStatus required,
    createdBy String
}

enum VendorTenantStatus {
    DRAFT,
    SUBMITTED,
    PENDING,
    APPROVED,
    DENIED,
    ACTIVE,
    INACTIVE,
    SUSPENDED,
    VOIDED
}

entity Tenant {
    tenantNumber String unique required,
    status TenantStatus required,
    name String required,
    phoneNumber String,
    websiteURL String maxlength(100),
    logo ImageBlob,
    createdBy String,
    createdOn Instant,
    updatedBy String,
    updatedOn Instant
}

entity TenantBankAccount {
    bankName String,
    routingNumber String required pattern(/^[0-9]{9,9}$/),
    accountNumber String required pattern(/^[0-9]{7,14}$/),
    currentCheckNumber String required,
    createdBy String,
    createdOn Instant,
    updatedBy String,
    updatedOn Instant
}

entity TenantBankFileSpec {
    tenantPaymentType TenantPaymentType required,
    fileExportType TenantBankFileExportType required,
    fileType TenantBankFileType required,
    filePathLocation String
}

enum TenantPaymentType {
    CHECK,
    EFT,
    CREDIT_CARD
}

enum TenantBankFileExportType {
    CSV
}

enum TenantBankFileType {
    STANDARD,
    CUSTOM
}

enum TenantTaxClassType {
    INDIVIDUAL_SOLE_PROPRIETER,
    CORPORATION,
    PARTNERSHIP,
    LIMITED_LIABILITY_COMPANY
}

entity TenantTaxInformation {
    isActive Boolean,
    taxIdentityNumber String unique required pattern(/^(\d{2})-(\d{7})$/),
    taxClass TenantTaxClassType required,
    purchaseDate LocalDate required,
    legalBusinessName String required,
    createdBy String,
    createdOn Instant,
    updatedBy String,
    updatedOn Instant
}

entity TenantContact {
    sequenceNumber Integer required,
    isActive Boolean,
    contactType TenantContactType required,
    firstName String required,
    lastName String,
    createdBy String,
    createdOn Instant,
    updatedBy String,
    updatedOn Instant
}

entity TenantContactInformation {
    contactMethod TenantContactMethodType required,
    emailAddress String,
    businessPhoneNumber String,
    extension String,
    mobilePhoneNumber String,
    homePhoneNumber String,
    faxNumber String,
    createdBy String,
    createdOn Instant,
    updatedBy String,
    updatedOn Instant
}

enum TenantContactMethodType {
    EMAIL,
    MOBILE_PHONE,
    BUSINESS_PHONE,
    HOME_PHONE,
    FAX
}

enum TenantContactType {
    TENANT_INVOICING,
    COVERAGE_VERIFICATION
}

entity TenantAddress {
    streetAddress String required,
    suiteNumber String,
    city String required,
    stateProvidence String required,
    zipcode String required,
    latitude String,
    longitude String,
    createdBy String,
    createdOn Instant,
    updatedBy String,
    updatedOn Instant
}

entity TenantStatusHistory {
    sequenceNumber Integer required,
    dateTime Instant required,
    status TenantStatus required,
    createdBy String
}

enum TenantStatus {
    ACTIVE,
    INACTIVE,
    DEACTIVATED,
    SUSPENDED,
    DELETED,
    VOID
}

paginate Tenant, TenantStatusHistory, TenantAddress, TenantContact,
TenantTaxInformation, TenantBankAccount, TenantContactInformation,
TenantVendor, TenantVendorStatusHistory, TenantBankFileSpec with pagination
service Tenant, TenantStatusHistory, TenantAddress, TenantContact,
TenantTaxInformation, TenantBankAccount, TenantContactInformation,
TenantVendor, TenantVendorStatusHistory, TenantBankFileSpec with serviceClass
dto Tenant, TenantStatusHistory, TenantAddress, TenantContact,
TenantTaxInformation, TenantBankAccount, TenantContactInformation,
TenantVendor, TenantVendorStatusHistory, TenantBankFileSpec with mapstruct
filter Tenant, TenantStatusHistory, TenantAddress, TenantContact,
TenantTaxInformation, TenantBankAccount, TenantContactInformation,
TenantVendor, TenantVendorStatusHistory, TenantBankFileSpec
microservice Tenant, TenantStatusHistory, TenantAddress, TenantContact,
TenantTaxInformation, TenantBankAccount, TenantContactInformation,
TenantVendor, TenantVendorStatusHistory, TenantBankFileSpec with tenant

  
Entity configuration(s) entityName.json files generated in the .jhipster directory

{ "name": "TenantBankFileSpec", "fields": [ { "fieldName": "tenantPaymentType", "fieldType": "TenantPaymentType", "fieldValues": "CHECK,EFT,CREDIT_CARD", "fieldValidateRules": ["required"] }, { "fieldName": "fileExportType", "fieldType": "TenantBankFileExportType", "fieldValues": "CSV", "fieldValidateRules": ["required"] }, { "fieldName": "fileType", "fieldType": "TenantBankFileType", "fieldValues": "STANDARD,CUSTOM", "fieldValidateRules": ["required"] }, { "fieldName": "filePathLocation", "fieldType": "String" } ], "relationships": [ { "relationshipType": "many-to-one", "otherEntityName": "tenant", "otherEntityRelationshipName": "tenantBankFileSpec", "relationshipValidateRules": "required", "relationshipName": "tenant", "otherEntityField": "id" }, { "relationshipType": "many-to-one", "otherEntityName": "tenantBankAccount", "otherEntityRelationshipName": "tenantBankFileSpec", "relationshipValidateRules": "required", "relationshipName": "tenantBankAccount", "otherEntityField": "id" } ], "changelogDate": "20200720000153", "entityTableName": "tenant_bank_file_spec", "dto": "mapstruct", "pagination": "pagination", "service": "serviceClass", "jpaMetamodelFiltering": true, "fluentMethods": true, "readOnly": false, "embedded": false, "clientRootFolder": "", "applications": ["apigateway", "tenant"], "microserviceName": "tenant" }

Browsers and Operating System

MacOS Catalina 10.15.5

mraible commented 4 years ago

@RDsideNow Are you able to contribute a fix for this? A single enum seems kinda silly, IMO.

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted. We are accepting PRs :smiley:. Comment or this will be closed in 7 days

DanielFran commented 2 years ago

@RDsideNow do you want to contribute with a fix, or should we close this issue?

DanielFran commented 1 year ago

Closing since no action since this has been opened