Closed ArihantKumarJain1 closed 2 years ago
Not sure search with true
is legit.
Hi, I think I found the issue and would like to contribute.
/generators/spring-controller/index.js - This sub-generator does not seem to call the loadDerivedServerConfig() method that builds the configuration.get(PACKAGE_FOLDER);
I tried calling loadDerivedServerConfig() through the _loading() priority and everything seems to be working fine. This is how the spring-service subgenerator is coded.
I have the following questions regarding unit tests, The existing test seems to be using a .yo-rc.json (test/templates/default/.yo-rc.json) which has the packageFolder attribute set, but when a new project is generated using the latest JHipster this attribute is not found,
so my 1st attempt was to remove this attribute from the test and ran them. Around 7 tests failed (mostly due to snapshot mismatch) and I manually fixed all the failing snapshots (all of them were simply copying the .yo-rc.json to the test project for test generation)
My 2nd attempt was to create a new test and manipulate the test/templates/default/.yo-rc.json while copying to remove the packageFolder attribute. This way I don't have to touch any existing test snapshots.
Which approach would you guys prefer?
Rest controller generation issue Welcome to JHipster v7.8.1
The spring-controller Foo is being created. ? Do you want to add an action to your controller? Yes ? What is the name of your action? getData ? What is the HTTP method of your action? GET ? Do you want to add an action to your controller? Yes ? What is the name of your action? insertData ? What is the HTTP method of your action? POST ? Do you want to add an action to your controller? Yes ? What is the name of your action? updateData ? What is the HTTP method of your action? PUT ? Do you want to add an action to your controller? Yes ? What is the name of your action? deleteData ? What is the HTTP method of your action? DELETE ? Do you want to add an action to your controller? Yes ? What is the name of your action? fetchAllData ? What is the HTTP method of your action? GET ? Do you want to add an action to your controller? No adding Get action 'getData' for /api/foo/get-data adding Post action 'insertData' for /api/foo/insert-data adding Put action 'updateData' for /api/foo/update-data adding Delete action 'deleteData' for /api/foo/delete-data adding Get action 'fetchAllData' for /api/foo/fetch-all-data force .yo-rc-global.json force .yo-rc.json create src\main\java\undefined\web\rest\FooResource.java create src\test\java\undefined\web\rest\FooResourceIT.java
No change to package.json was detected. No package manager install will be executed. Congratulations, JHipster execution is complete! Sponsored with ❤️ by @oktadev.
Jhipster Info details. Welcome to JHipster v7.8.1
Welcome to the JHipster Information Sub-Generator
JHipster Version(s)
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Environment and Tools
openjdk version "17.0.3" 2022-04-19 OpenJDK Runtime Environment Temurin-17.0.3+7 (build 17.0.3+7) OpenJDK 64-Bit Server VM Temurin-17.0.3+7 (build 17.0.3+7, mixed mode, sharing)
git version 2.36.0.windows.1
node: v16.15.0
npm: 8.9.0
No change to package.json was detected. No package manager install will be executed. Congratulations, JHipster execution is complete! Sponsored with ❤️ by @oktadev.