Skip to content

Commit c46ca97

Browse files
author
NetoDevel
committed
Adds @entity into generator model
1 parent fab764b commit c46ca97

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

templates/src/main/java/br/com/templates/entity/EntityExecutor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ private void validateTokenAtrribute(String attribute) {
9393

9494
public String generateClass(String nameClass) {
9595
return "" +
96+
"@Entity\n" +
9697
"@Data\n" +
9798
"public class ".concat(nameClass).concat(" {\n") +
9899
"${attributes}" +

templates/src/test/java/br/com/templates/entity/EntityCacheTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public void shouldReturnContentOfUser() {
2727
entityExecutor.run("User", valueArgument);
2828

2929
String expectedValue = "" +
30+
"@Entity\n" +
3031
"@Data\n" +
3132
"public class User {\n" +
3233
"\tprivate String name;\n" +
@@ -44,6 +45,7 @@ public void shouldReturnContentOfFoo() {
4445
entityExecutor.run("User", valueArgument);
4546

4647
String expectedValue = "" +
48+
"@Entity\n" +
4749
"@Data\n" +
4850
"public class Foo {\n" +
4951
"\tprivate String foo;\n" +

templates/src/test/java/br/com/templates/entity/EntityExecutorTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public void setUp() {
1919
@Test
2020
public void shouldCreateEntity() {
2121
String expectedValue = "" +
22+
"@Entity\n" +
2223
"@Data\n" +
2324
"public class User {\n" +
2425
"\tprivate String name;\n" +
@@ -42,6 +43,7 @@ public void givenTypeThatNotExists_shouldInvokeException() {
4243
@Test
4344
public void givenRelationHasMany_shouldReturnWithRelation() {
4445
String expectedValue = "" +
46+
"@Entity\n" +
4547
"@Data\n" +
4648
"public class User {\n" +
4749
"\tprivate String name;\n" +
@@ -59,6 +61,7 @@ public void givenRelationHasMany_shouldReturnWithRelation() {
5961
@Test
6062
public void givenRelationBelongsTo_shouldReturnWithRelation() {
6163
String expectedValue = "" +
64+
"@Entity\n" +
6265
"@Data\n" +
6366
"public class User {\n" +
6467
"\tprivate String name;\n" +
@@ -76,6 +79,7 @@ public void givenRelationBelongsTo_shouldReturnWithRelation() {
7679
@Test
7780
public void shouldGenerateClass() {
7881
String expectedValue = "" +
82+
"@Entity\n" +
7983
"@Data\n" +
8084
"public class User {\n" +
8185
"${attributes}" +
@@ -88,6 +92,7 @@ public void shouldGenerateClass() {
8892
@Test
8993
public void shouldGenerateClassWithCorrectName() {
9094
String expectedValue = "" +
95+
"@Entity\n" +
9196
"@Data\n" +
9297
"public class Foo {\n" +
9398
"${attributes}" +

0 commit comments

Comments
 (0)