Repository: jhipster/generator-jhipster (ts)

Issue:
pkType should be decided from a single place
<!--
- Please follow the issue template below for bug reports.
- If you have a support request rather than a bug, please use [Stack Overflow](http://stackoverflow.com/questions/tagged/jhipster) with the JHipster tag.
- For bug reports it is mandatory to run the command `jhipster info` in your project's root folder, and paste the result here.
- Tickets opened without any of these pieces of information will be **closed** without any explanation.
-->

##### **Overview of the issue**

<!-- Explain the bug, if an error is being thrown a stack trace helps -->
`pkType` is not being decided from a single place which causes inconsistency if someone relies on `getPkType` from `generator-base-private.js`.

I am talking specifically for db type `cassandra` which is managed in sub-generator at https://github.com/jhipster/generator-jhipster/blob/master/generators/entity-server/index.js#L33

##### **Motivation for or Use Case**
Deciding pk from a single place will remove the inconsistency.
I am not getting the correct pk type which is `UUID` but rather getting `String`

<!-- Explain why this is a bug for you -->

##### **Reproduce the error**

<!-- For bug reports, an unambiguous set of steps to reproduce the error -->
- Use `getPkType(databaseType)` to get PK type by passing `cassandra` and you will get `String` rather than `UUID`

##### **Related issues**

<!-- Has a similar issue been reported before? Please search both closed & open issues -->

##### **Suggest a Fix**

<!-- If you can't fix the bug yourself, perhaps you can point to what might be
  causing the problem (line of code or commit) -->
- merge pkType initialization from sub-generator to generator base file.

##### **JHipster Version(s)**

```
travis-cassandra@0.0.0 /Users/sierra/github/temp/ngx-session-cassandra-fr
└── generator-jhipster@6.1.2 

```


##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**


<details>
<summary>.yo-rc.json file</summary>
<pre>
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "baseName": "travisCassandra",
    "packageName": "io.github.jhipster.travis",
    "packageFolder": "io/github/jhipster/travis",
    "authenticationType": "session",
    "cacheProvider": "no",
    "enableHibernateCache": false,
    "websocket": false,
    "databaseType": "cassandra",
    "devDatabaseType": "cassandra",
    "prodDatabaseType": "cassandra",
    "searchEngine": false,
    "buildTool": "maven",
    "enableTranslation": true,
    "nativeLanguage": "fr",
    "languages": ["en", "fr"],
    "rememberMeKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "testFrameworks": ["gatling"],
    "serverPort": "8080",
    "jhiPrefix": "jhi",
    "travis": true,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "clientPackageManager": "npm",
    "clientFramework": "angularX",
    "jhipsterVersion": "6.1.2",
    "useSass": true,
    "clientTheme": "none",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [],
    "blueprints": []
  }
}

</pre>
</details>


##### **JDL for the Entity configuration(s) `entityName.json` files generated in the `.jhipster` directory**

<details>
<summary>JDL entity definitions</summary>

<pre>
entity CassBankAccount {
  userId UUID,
  name String required,
  bankNumber Integer,
  agencyNumber Long,
  lastOperationDuration Float,
  meanOperationDuration Double,
  balance BigDecimal required,
  lastOperationDate Date,
  active Boolean,
  picture ByteBuffer required,
  operationsFile ByteBuffer
}
entity CassTestEntity {
  stringField String,
  stringRequiredField String required,
  stringMinlengthField String minlength(0),
  stringMaxlengthField String maxlength(20),
  stringPatternField String pattern(/^[a-zA-Z0-9]*$/),
  integerField Integer,
  integerRequiredField Integer required,
  integerMinField Integer min(0),
  integerMaxField Integer max(100),
  longField Long,
  longRequiredField Long required,
  longMinField Long min(0),
  longMaxField Long max(100),
  floatField Float,
  floatRequiredField Float required,
  floatMinField Float min(0),
  floatMaxField Float max(100),
  doubleRequiredField Double required,
  doubleMinField Double min(0),
  doubleMaxField Double max(100),
  bigDecimalRequiredField BigDecimal required,
  bigDecimalMinField BigDecimal min(0),
  bigDecimalMaxField BigDecimal max(100),
  dateField Date,
  dateRequiredField Date required,
  zonedDateTimeField ZonedDateTime,
  zonedDateTimeRequiredField ZonedDateTime required,
  booleanField Boolean,
  booleanRequiredField Boolean required,
  picture ByteBuffer required,
  operationsFile ByteBuffer
}
entity CassTestMapstructEntity {
  stringField String,
  stringRequiredField String required,
  stringMinlengthField String minlength(0),
  stringMaxlengthField String maxlength(20),
  stringPatternField String pattern(/^[a-zA-Z0-9]*$/),
  integerField Integer,
  integerRequiredField Integer required,
  integerMinField Integer min(0),
  integerMaxField Integer max(100),
  longField Long,
  longRequiredField Long required,
  longMinField Long min(0),
  longMaxField Long max(100),
  floatField Float,
  floatRequiredField Float required,
  floatMinField Float min(0),
  floatMaxField Float max(100),
  doubleRequiredField Double required,
  doubleMinField Double min(0),
  doubleMaxField Double max(100),
  bigDecimalRequiredField BigDecimal required,
  bigDecimalMinField BigDecimal min(0),
  bigDecimalMaxField BigDecimal max(100),
  dateField Date,
  dateRequiredField Date required,
  zonedDateTimeField ZonedDateTime,
  zonedDateTimeRequiredField ZonedDateTime required,
  booleanField Boolean,
  booleanRequiredField Boolean required,
  picture ByteBuffer required,
  operationsFile ByteBuffer
}
entity CassTestServiceClassEntity {
  stringField String,
  stringRequiredField String required,
  stringMinlengthField String minlength(0),
  stringMaxlengthField String maxlength(20),
  stringPatternField String pattern(/^[a-zA-Z0-9]*$/),
  integerField Integer,
  integerRequiredField Integer required,
  integerMinField Integer min(0),
  integerMaxField Integer max(100),
  longField Long,
  longRequiredField Long required,
  longMinField Long min(0),
  longMaxField Long max(100),
  floatField Float,
  floatRequiredField Float required,
  floatMinField Float min(0),
  floatMaxField Float max(100),
  doubleRequiredField Double required,
  doubleMinField Double min(0),
  doubleMaxField Double max(100),
  bigDecimalRequiredField BigDecimal required,
  bigDecimalMinField BigDecimal min(0),
  bigDecimalMaxField BigDecimal max(100),
  dateField Date,
  dateRequiredField Date required,
  zonedDateTimeField ZonedDateTime,
  zonedDateTimeRequiredField ZonedDateTime required,
  booleanField Boolean,
  booleanRequiredField Boolean required,
  picture ByteBuffer required,
  operationsFile ByteBuffer
}
entity CassTestServiceImplEntity {
  stringField String,
  stringRequiredField String required,
  stringMinlengthField String minlength(0),
  stringMaxlengthField String maxlength(20),
  stringPatternField String pattern(/^[a-zA-Z0-9]*$/),
  integerField Integer,
  integerRequiredField Integer required,
  integerMinField Integer min(0),
  integerMaxField Integer max(100),
  longField Long,
  longRequiredField Long required,
  longMinField Long min(0),
  longMaxField Long max(100),
  floatField Float,
  floatRequiredField Float required,
  floatMinField Float min(0),
  floatMaxField Float max(100),
  doubleRequiredField Double required,
  doubleMinField Double min(0),
  doubleMaxField Double max(100),
  bigDecimalRequiredField BigDecimal required,
  bigDecimalMinField BigDecimal min(0),
  bigDecimalMaxField BigDecimal max(100),
  dateField Date,
  dateRequiredField Date required,
  zonedDateTimeField ZonedDateTime,
  zonedDateTimeRequiredField ZonedDateTime required,
  booleanField Boolean,
  booleanRequiredField Boolean required,
  picture ByteBuffer required,
  operationsFile ByteBuffer
}
dto CassBankAccount, CassTestMapstructEntity with mapstruct
service CassBankAccount, CassTestMapstructEntity, CassTestServiceImplEntity with serviceImpl
service CassTestServiceClassEntity with serviceClass
angularSuffix CassBankAccount with mySuffix
filter CassTestServiceClassEntity, CassTestServiceImplEntity

</pre>
</details>


##### **Environment and Tools**

java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)

git version 2.20.1 (Apple Git-117)

node: v10.14.2

npm: 6.10.0

yeoman: 3.1.0

Docker version 18.09.1, build 4c52b90

docker-compose version 1.23.2, build 1110ad01

##### **Browsers and Operating System**

<!-- What OS are you on? is this a problem with all browsers or only IE8? -->

-   [x] Checking this box is mandatory (this is just to show you read everything)

<!-- Love JHipster? Please consider supporting our collective:
👉  https://opencollective.com/generator-jhipster/donate -->


Pull request:
Refactor to get PK type from single place
Fixes #10082 


-   Please make sure the below checklist is followed for Pull Requests.

-   [x] [Travis tests](https://travis-ci.org/jhipster/generator-jhipster/pull_requests) are green
-   [x] Tests are added where necessary
-   [x] Documentation is added/updated where necessary
-   [x] Coding Rules & Commit Guidelines as per our [CONTRIBUTING.md document](https://github.com/jhipster/generator-jhipster/blob/master/CONTRIBUTING.md) are followed

<!--
Please also reference the issue number in a commit message to [automatically close the related Github issue](https://help.github.com/articles/closing-issues-via-commit-messages/)

Note: It is also possible to add `[skip ci]` to your commit message to skip Travis tests
-->


Patch:
diff --git a/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management-delete-dialog.component.ts.ejs b/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management-delete-dialog.component.ts.ejs
index fdd0235823..25de8cb430 100644
--- a/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management-delete-dialog.component.ts.ejs
+++ b/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management-delete-dialog.component.ts.ejs
@@ -44,7 +44,7 @@ export class <%= entityAngularName %>DeleteDialogComponent {
         this.activeModal.dismiss('cancel');
     }
 
-    confirmDelete(id: <% if (pkType === 'String') { %>string<% } else { %>number<% } %>) {
+    confirmDelete(id: <% if (pkType === 'String' || pkType === 'UUID') { %>string<% } else { %>number<% } %>) {
         this.<%= entityInstance %>Service.delete(id).subscribe((response) => {
             this.eventManager.broadcast({
                 name: '<%= entityInstance %>ListModification',
diff --git a/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity.service.ts.ejs b/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity.service.ts.ejs
index 61b9f41228..071a462c5f 100644
--- a/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity.service.ts.ejs
+++ b/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity.service.ts.ejs
@@ -62,7 +62,7 @@ export class <%= entityAngularName %>Service {
             <% if (fieldsContainDate) { %>.pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)))<% } %>;
     }
 
-    find(id: <% if (pkType === 'String') { %>string<% } else { %>number<% } %>): Observable<EntityResponseType> {
+    find(id: <% if (pkType === 'String'  || pkType === 'UUID') { %>string<% } else { %>number<% } %>): Observable<EntityResponseType> {
         return this.http.get<I<%= entityAngularName %>>(`${this.resourceUrl}/${id}`, { observe: 'response'})
             <% if (fieldsContainDate) { %>.pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)))<% } %>;
     }
@@ -73,7 +73,7 @@ export class <%= entityAngularName %>Service {
             <% if (fieldsContainDate) { %>.pipe(map((res: EntityArrayResponseType) => this.convertDateArrayFromServer(res)))<% } %>;
     }
 
-    delete(id: <% if (pkType === 'String') { %>string<% } else { %>number<% } %>): Observable<HttpResponse<any>> {
+    delete(id: <% if (pkType === 'String' || pkType === 'UUID') { %>string<% } else { %>number<% } %>): Observable<HttpResponse<any>> {
         return this.http.delete<any>(`${this.resourceUrl}/${id}`, { observe: 'response'});
     }
 
diff --git a/generators/entity-server/index.js b/generators/entity-server/index.js
index 9bd887c8ae..7c68f45dbe 100644
--- a/generators/entity-server/index.js
+++ b/generators/entity-server/index.js
@@ -30,9 +30,6 @@ module.exports = class extends BaseBlueprintGenerator {
         utils.copyObjectProps(this, opts.context);
         this.jhipsterContext = opts.jhipsterContext || opts.context;
         this.configOptions = opts.configOptions || {};
-        if (this.databaseType === 'cassandra') {
-            this.pkType = 'UUID';
-        }
 
         useBlueprints =
             !opts.fromBlueprint &&
diff --git a/generators/generator-base-private.js b/generators/generator-base-private.js
index 17d37a264a..3173ac9ba0 100644
--- a/generators/generator-base-private.js
+++ b/generators/generator-base-private.js
@@ -1043,7 +1043,7 @@ module.exports = class extends Generator {
     generateEntityClientFields(pkType, fields, relationships, dto, customDateType = 'Moment') {
         const variablesWithTypes = [];
         let tsKeyType;
-        if (pkType === 'String') {
+        if (pkType === 'String' || pkType === 'UUID') {
             tsKeyType = 'string';
         } else {
             tsKeyType = 'number';
@@ -1293,15 +1293,14 @@ module.exports = class extends Generator {
      * Generate a primary key, according to the type
      *
      * @param {any} pkType - the type of the primary key
-     * @param {any} prodDatabaseType - the database type
      */
-    generateTestEntityId(pkType, prodDatabaseType) {
+    generateTestEntityId(pkType) {
         if (pkType === 'String') {
-            if (prodDatabaseType === 'cassandra') {
-                return "'9fec3727-3421-4967-b213-ba36557ca194'";
-            }
             return "'123'";
         }
+        if (pkType === 'UUID') {
+            return "'9fec3727-3421-4967-b213-ba36557ca194'";
+        }
         return 123;
     }
 
@@ -1311,10 +1310,20 @@ module.exports = class extends Generator {
      * @param {any} databaseType - the database type
      */
     getPkType(databaseType) {
-        if (['cassandra', 'mongodb', 'couchbase'].includes(databaseType)) {
-            return 'String';
+        let pk = '';
+        switch (databaseType) {
+            case 'mongodb':
+            case 'couchbase':
+                pk = 'String';
+                break;
+            case 'cassandra':
+                pk = 'UUID';
+                break;
+            default:
+                pk = 'Long';
+                break;
         }
-        return 'Long';
+        return pk;
     }
 
     /**
diff --git a/generators/server/templates/src/main/java/package/service/UserService.java.ejs b/generators/server/templates/src/main/java/package/service/UserService.java.ejs
index f39a9e732e..16bd83260d 100644
--- a/generators/server/templates/src/main/java/package/service/UserService.java.ejs
+++ b/generators/server/templates/src/main/java/package/service/UserService.java.ejs
@@ -652,7 +652,7 @@ public class UserService {
     <%_ if (databaseType === 'sql') { _%>
     @Transactional(readOnly = true)
     <%_ } _%>
-    public <% if (reactive) { %>Mono<% } else { %>Optional<% } %><<%= asEntity('User') %>> getUserWithAuthorities(<%= pkType %> id) {
+    public <% if (reactive) { %>Mono<% } else { %>Optional<% } %><<%= asEntity('User') %>> getUserWithAuthorities(<% if (pkType === 'UUID') { %>String<% } else { %><%= pkType %><% } %> id) {
         <%_ if (databaseType === 'sql') { _%>
         return userRepository.findOneWithAuthoritiesById(id);
         <%_ } else { // MongoDB, Couchbase and and Cassandra _%>


Test patch:
diff --git a/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/user-management-update.component.spec.ts.ejs b/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/user-management-update.component.spec.ts.ejs
index 505484f6a4..16e87a6221 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/user-management-update.component.spec.ts.ejs
+++ b/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/user-management-update.component.spec.ts.ejs
@@ -17,7 +17,7 @@
  limitations under the License.
 -%>
 <%_
-const tsKeyId = generateTestEntityId(pkType, prodDatabaseType);
+const tsKeyId = generateTestEntityId(pkType);
 _%>
 import { ComponentFixture, TestBed, async, inject, fakeAsync, tick } from '@angular/core/testing';
 import { HttpResponse } from '@angular/common/http';
diff --git a/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/user-management.component.spec.ts.ejs b/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/user-management.component.spec.ts.ejs
index e5fea43203..98fef4612a 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/user-management.component.spec.ts.ejs
+++ b/generators/client/templates/angular/src/test/javascript/spec/app/admin/user-management/user-management.component.spec.ts.ejs
@@ -17,7 +17,7 @@
  limitations under the License.
 -%>
 <%_
-const tsKeyId = generateTestEntityId(pkType, prodDatabaseType);
+const tsKeyId = generateTestEntityId(pkType);
 _%>
 import { ComponentFixture, TestBed, async, inject, fakeAsync, tick } from '@angular/core/testing';
 import { Observable, of } from 'rxjs';
diff --git a/generators/client/templates/angular/src/test/javascript/spec/test.module.ts.ejs b/generators/client/templates/angular/src/test/javascript/spec/test.module.ts.ejs
index e24c63514e..154fa7a829 100644
--- a/generators/client/templates/angular/src/test/javascript/spec/test.module.ts.ejs
+++ b/generators/client/templates/angular/src/test/javascript/spec/test.module.ts.ejs
@@ -36,7 +36,7 @@ import { MockActivatedRoute, MockRouter } from './helpers/mock-route.service';
 import { MockActiveModal } from './helpers/mock-active-modal.service';
 import { MockEventManager } from './helpers/mock-event-manager.service';
 <%_
-const tsKeyId = generateTestEntityId(pkType, prodDatabaseType);
+const tsKeyId = generateTestEntityId(pkType);
 _%>
 
 @NgModule({
diff --git a/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management-delete-dialog.component.spec.ts.ejs b/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management-delete-dialog.component.spec.ts.ejs
index c242c44806..d04d91eddf 100644
--- a/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management-delete-dialog.component.spec.ts.ejs
+++ b/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management-delete-dialog.component.spec.ts.ejs
@@ -17,7 +17,7 @@
  limitations under the License.
 -%>
 <%_
-const tsKeyId = generateTestEntityId(pkType, prodDatabaseType);
+const tsKeyId = generateTestEntityId(pkType);
 _%>
 /* tslint:disable max-line-length */
 import { ComponentFixture, TestBed, inject, fakeAsync, tick } from '@angular/core/testing';
diff --git a/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management-detail.component.spec.ts.ejs b/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management-detail.component.spec.ts.ejs
index 538cb851a0..8a7707618c 100644
--- a/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management-detail.component.spec.ts.ejs
+++ b/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management-detail.component.spec.ts.ejs
@@ -17,7 +17,7 @@
  limitations under the License.
 -%>
 <%_
-const tsKeyId = generateTestEntityId(pkType, prodDatabaseType);
+const tsKeyId = generateTestEntityId(pkType);
 _%>
 /* tslint:disable max-line-length */
 import { ComponentFixture, TestBed } from '@angular/core/testing';
diff --git a/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management-update.component.spec.ts.ejs b/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management-update.component.spec.ts.ejs
index 11b4cb4087..eba6d0aea5 100644
--- a/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management-update.component.spec.ts.ejs
+++ b/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management-update.component.spec.ts.ejs
@@ -17,7 +17,7 @@
  limitations under the License.
 -%>
 <%_
-const tsKeyId = generateTestEntityId(pkType, prodDatabaseType);
+const tsKeyId = generateTestEntityId(pkType);
 _%>
 /* tslint:disable max-line-length */
 import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
diff --git a/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management.component.spec.ts.ejs b/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management.component.spec.ts.ejs
index e19c983173..517328e8bb 100644
--- a/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management.component.spec.ts.ejs
+++ b/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management.component.spec.ts.ejs
@@ -17,7 +17,7 @@
  limitations under the License.
 -%>
 <%_
-const tsKeyId = generateTestEntityId(pkType, prodDatabaseType);
+const tsKeyId = generateTestEntityId(pkType);
 _%>
 /* tslint:disable max-line-length */
 import { ComponentFixture, TestBed } from '@angular/core/testing';
diff --git a/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management.service.spec.ts.ejs b/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management.service.spec.ts.ejs
index 88ae661c35..d1c93f17bf 100644
--- a/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management.service.spec.ts.ejs
+++ b/generators/entity-client/templates/angular/src/test/javascript/spec/app/entities/entity-management.service.spec.ts.ejs
@@ -17,7 +17,7 @@
  limitations under the License.
 -%>
 <%_
-const tsKeyId = generateTestEntityId(pkType, prodDatabaseType);
+const tsKeyId = generateTestEntityId(pkType);
 const variablesWithTypes = generateEntityClientFields(pkType, fields, relationships, dto);
 _%>
 /* tslint:disable max-line-length */
@@ -66,7 +66,7 @@ describe('Service Tests', () => {
             <%_ } _%>
 
             elemDefault = new <%= entityAngularName %>(
-                <%_ if (pkType === 'String') { _%>
+                <%_ if (pkType === 'String' || pkType === 'UUID') { _%>
                 'ID',
                 <%_ } else { _%>
                 0,
@@ -116,7 +116,7 @@ describe('Service Tests', () => {
 
             it('should create a <%= entityAngularName %>', async () => {
                 const returnedFromService = Object.assign({
-<%_ if (pkType === 'String') { _%>
+<%_ if (pkType === 'String' || pkType === 'UUID') { _%>
                     id: 'ID',
 <%_ } else { _%>
                     id: 0,
diff --git a/test/generator-base-private.spec.js b/test/generator-base-private.spec.js
index 92a4da6fac..e918d4da9e 100644
--- a/test/generator-base-private.spec.js
+++ b/test/generator-base-private.spec.js
@@ -170,9 +170,9 @@ export * from './entityFolderName/entityFileName.state';`;
                 expect(BaseGenerator.generateTestEntityId('String')).to.equal("'123'");
             });
         });
-        describe('when called with String and cassandra', () => {
+        describe('when called with UUID', () => {
             it("return '9fec3727-3421-4967-b213-ba36557ca194'", () => {
-                expect(BaseGenerator.generateTestEntityId('String', 'cassandra')).to.equal("'9fec3727-3421-4967-b213-ba36557ca194'");
+                expect(BaseGenerator.generateTestEntityId('UUID')).to.equal("'9fec3727-3421-4967-b213-ba36557ca194'");
             });
         });
     });