jhipster / generator-jhipster-micronaut

Micronaut blueprint for JHipster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test compilation failure with entity generated with service option

murdos opened this issue · comments

Overview of the issue

Test compilation failure:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on project jhipster: Compilation failure: Compilation failure:
[ERROR] /C:/dev/workspace/jhipster/tests/mn-mvn-jwt-angular/src/test/java/com/mycompany/myapp/web/rest/LabelResourceIT.java:[165,9] cannot find symbol
[ERROR] symbol: variable labelService
[ERROR] location: class com.mycompany.myapp.web.rest.LabelResourceIT
[ERROR] /C:/dev/workspace/jhipster/tests/mn-mvn-jwt-angular/src/test/java/com/mycompany/myapp/web/rest/LabelResourceIT.java:[210,9] cannot find symbol
[ERROR] symbol: variable labelService
[ERROR] location: class com.mycompany.myapp.web.rest.LabelResourceIT

Reproduce the error

Generate an entity with serviceClass or serviceImpl value for service option.

Related issues
Suggest a Fix

Always save the test entity with the entity repository, no need to conditionally use the entity service.

Project configuration
Entity configuration(s) entityName.json files generated in the .jhipster directory
{
  "name": "Label",
  "fields": [
    {
      "fieldName": "label",
      "fieldType": "String",
      "fieldValidateRules": ["required", "minlength"],
      "fieldValidateRulesMinlength": "3"
    }
  ],
  "relationships": [
    {
      "relationshipType": "many-to-many",
      "otherEntityName": "operation",
      "otherEntityRelationshipName": "label",
      "relationshipName": "operation",
      "otherEntityField": "id",
      "ownerSide": false
    }
  ],
  "changelogDate": "20201020221801",
  "entityTableName": "label",
  "dto": "no",
  "pagination": "no",
  "service": "serviceClass",
  "jpaMetamodelFiltering": false,
  "fluentMethods": true,
  "readOnly": false,
  "embedded": false,
  "clientRootFolder": "",
  "applications": ["jhipster"]
}
Browsers and Operating System
  • Checking this box is mandatory (this is just to show you read everything)