Generator-jhipster: Make Test Data for Entity Property More Expressive

Created on 24 Feb 2020  路  2Comments  路  Source: jhipster/generator-jhipster

Overview of the feature request

make test data for entity property more expressive

current:

public static final String DEFAULT_ENTITY_PROPERTY = "AAAAAAAAAA";
public static final String UPDATED_ENTITY_PROPERTY= "BBBBBBBBBB";

wanted:

public static final String DEFAULT_ENTITY_PROPERTY = "DEFAULT_ENTITY_PROPERTY";
public static final String UPDATED_ENTITY_PROPERTY= "UPDATED_ENTITY_PROPERTY";
Motivation for or Use Case
Related issues or PR
  • [x] Checking this box is mandatory (this is just to show you read everything)
area tests

Most helpful comment

Hello @geyuqiu ,
For now, the logic used is based on the fieldValidateRulesMaxlength and the fieldValidateRulesMinlength. That's why we didn't define an expressive constant, it could change the word or crop it. Especially these values are used for UT, so we don't need a string value too much expressive :)

All 2 comments

Hello @geyuqiu ,
For now, the logic used is based on the fieldValidateRulesMaxlength and the fieldValidateRulesMinlength. That's why we didn't define an expressive constant, it could change the word or crop it. Especially these values are used for UT, so we don't need a string value too much expressive :)

@geyuqiu Thanks for pointing this out.
As @seraphinandrieux said, we also do some validation on String lengths to see if Spring validation is OK. Using meaningful test Strings will result in cropped values on some cases.

I prefer keeping what we have and not invest much time on this, so I'm closing this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pascalgrimaud picture pascalgrimaud  路  3Comments

sdoxsee picture sdoxsee  路  4Comments

tomj0101 picture tomj0101  路  3Comments

SudharakaP picture SudharakaP  路  3Comments

frantzynicolas picture frantzynicolas  路  3Comments