Skip to content

Commit ad6e269

Browse files
committed
fat: update structure avoid tck names
Signed-off-by: Otavio Santana <[email protected]>
1 parent b50929d commit ad6e269

File tree

8 files changed

+72
-72
lines changed

8 files changed

+72
-72
lines changed

jnosql-arangodb/src/test/java/org/eclipse/jnosql/databases/arangodb/mapping/ArangoDBDocumentRepositoryProxyTest.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,35 +61,35 @@ public class ArangoDBDocumentRepositoryProxyTest {
6161
@Inject
6262
private Converters converters;
6363

64-
private PersonRepository personRepository;
64+
private HumanRepository humanRepository;
6565

6666
@SuppressWarnings("rawtypes")
6767
@BeforeEach
6868
public void setUp() {
6969
this.template = Mockito.mock(ArangoDBTemplate.class);
7070

7171
ArangoDBDocumentRepositoryProxy handler = new ArangoDBDocumentRepositoryProxy<>(template,
72-
PersonRepository.class, converters, entitiesMetadata);
72+
HumanRepository.class, converters, entitiesMetadata);
7373

7474
when(template.insert(any(Human.class))).thenReturn(new Human());
7575
when(template.insert(any(Human.class), any(Duration.class))).thenReturn(new Human());
7676
when(template.update(any(Human.class))).thenReturn(new Human());
77-
this.personRepository = (PersonRepository) Proxy.newProxyInstance(PersonRepository.class.getClassLoader(),
78-
new Class[]{PersonRepository.class},
77+
this.humanRepository = (HumanRepository) Proxy.newProxyInstance(HumanRepository.class.getClassLoader(),
78+
new Class[]{HumanRepository.class},
7979
handler);
8080
}
8181

8282

8383
@Test
8484
public void shouldFindAll() {
85-
personRepository.findAllQuery();
85+
humanRepository.findAllQuery();
8686
verify(template).aql("FOR p IN Person RETURN p", emptyMap());
8787
}
8888

8989
@Test
9090
public void shouldFindByNameAQL() {
9191
ArgumentCaptor<Map> captor = ArgumentCaptor.forClass(Map.class);
92-
personRepository.findByName("Ada");
92+
humanRepository.findByName("Ada");
9393
verify(template).aql(eq("FOR p IN Person FILTER p.name = @name RETURN p"), captor.capture());
9494

9595
Map value = captor.getValue();
@@ -99,7 +99,7 @@ public void shouldFindByNameAQL() {
9999
@Test
100100
public void shouldSaveUsingInsert() {
101101
Human human = Human.of("Ada", 10);
102-
personRepository.save(human);
102+
humanRepository.save(human);
103103
verify(template).insert(eq(human));
104104
}
105105

@@ -108,37 +108,37 @@ public void shouldSaveUsingInsert() {
108108
public void shouldSaveUsingUpdate() {
109109
Human human = Human.of("Ada-2", 10);
110110
when(template.find(Human.class, "Ada-2")).thenReturn(Optional.of(human));
111-
personRepository.save(human);
111+
humanRepository.save(human);
112112
verify(template).update(eq(human));
113113
}
114114

115115
@Test
116116
public void shouldDelete(){
117-
personRepository.deleteById("id");
117+
humanRepository.deleteById("id");
118118
verify(template).delete(Human.class, "id");
119119
}
120120

121121

122122
@Test
123123
public void shouldDeleteEntity(){
124124
Human human = Human.of("Ada", 10);
125-
personRepository.delete(human);
125+
humanRepository.delete(human);
126126
verify(template).delete(Human.class, human.getName());
127127
}
128128

129129
@Test
130130
public void shouldDeleteAll() {
131131
ArgumentCaptor<Class<?>> queryCaptor = ArgumentCaptor.forClass(Class.class);
132132

133-
personRepository.deleteAll();
133+
humanRepository.deleteAll();
134134
verify(template).deleteAll(queryCaptor.capture());
135135

136136
Class<?> query = queryCaptor.getValue();
137137
Assertions.assertThat(query).isEqualTo(Human.class);
138138
}
139139

140140

141-
interface PersonRepository extends ArangoDBRepository<Human, String> {
141+
interface HumanRepository extends ArangoDBRepository<Human, String> {
142142

143143
@AQL("FOR p IN Person RETURN p")
144144
List<Human> findAllQuery();

jnosql-cassandra/src/test/java/org/eclipse/jnosql/databases/cassandra/mapping/CassandraRepositoryProxyTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,19 @@ public class CassandraRepositoryProxyTest {
6060
@Inject
6161
private EntitiesMetadata entitiesMetadata;
6262

63-
private PersonRepository personRepository;
63+
private HumanRepository personRepository;
6464

6565
@BeforeEach
6666
public void setUp() {
6767
this.template = Mockito.mock(CassandraTemplate.class);
6868
CassandraRepositoryProxy handler = new CassandraRepositoryProxy(template,
69-
PersonRepository.class, converters, entitiesMetadata);
69+
HumanRepository.class, converters, entitiesMetadata);
7070

7171
when(template.insert(any(Contact.class))).thenReturn(new Contact());
7272
when(template.insert(any(Contact.class), any(Duration.class))).thenReturn(new Contact());
7373
when(template.update(any(Contact.class))).thenReturn(new Contact());
74-
this.personRepository = (PersonRepository) Proxy.newProxyInstance(PersonRepository.class.getClassLoader(),
75-
new Class[]{PersonRepository.class},
74+
this.personRepository = (HumanRepository) Proxy.newProxyInstance(HumanRepository.class.getClassLoader(),
75+
new Class[]{HumanRepository.class},
7676
handler);
7777
}
7878

@@ -140,7 +140,7 @@ public void shouldDeleteEntity(){
140140
verify(template).delete(Contact.class, contact.getName());
141141
}
142142

143-
interface PersonRepository extends CassandraRepository<Contact, String> {
143+
interface HumanRepository extends CassandraRepository<Contact, String> {
144144

145145
void deleteByName(String namel);
146146

jnosql-couchbase/src/test/java/org/eclipse/jnosql/databases/couchbase/mapping/CouchbaseDocumentRepositoryProxyTest.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,35 +61,35 @@ public class CouchbaseDocumentRepositoryProxyTest {
6161
@Inject
6262
private EntitiesMetadata entitiesMetadata;
6363

64-
private PersonRepository personRepository;
64+
private HumanRepository humanRepository;
6565

6666

6767
@BeforeEach
6868
public void setUp() {
6969
this.template = Mockito.mock(CouchbaseTemplate.class);
7070

7171
CouchbaseDocumentRepositoryProxy handler = new CouchbaseDocumentRepositoryProxy(template,
72-
PersonRepository.class, converters, entitiesMetadata);
72+
HumanRepository.class, converters, entitiesMetadata);
7373

7474
when(template.insert(any(Human.class))).thenReturn(new Human());
7575
when(template.insert(any(Human.class), any(Duration.class))).thenReturn(new Human());
7676
when(template.update(any(Human.class))).thenReturn(new Human());
77-
personRepository = (PersonRepository) Proxy.newProxyInstance(PersonRepository.class.getClassLoader(),
78-
new Class[]{PersonRepository.class},
77+
humanRepository = (HumanRepository) Proxy.newProxyInstance(HumanRepository.class.getClassLoader(),
78+
new Class[]{HumanRepository.class},
7979
handler);
8080
}
8181

8282

8383
@Test
8484
public void shouldFindAll() {
85-
personRepository.findAllQuery();
85+
humanRepository.findAllQuery();
8686
verify(template).n1qlQuery("select * from Person");
8787
}
8888

8989
@Test
9090
public void shouldFindByNameN1ql() {
9191
ArgumentCaptor<JsonObject> captor = ArgumentCaptor.forClass(JsonObject.class);
92-
personRepository.findByName("Ada");
92+
humanRepository.findByName("Ada");
9393
verify(template).n1qlQuery(Mockito.eq("select * from Person where name = $name"), captor.capture());
9494

9595
JsonObject value = captor.getValue();
@@ -100,7 +100,7 @@ public void shouldFindByNameN1ql() {
100100
@Test
101101
public void shouldSaveUsingInsert() {
102102
Human human = Human.of("Ada", 10);
103-
personRepository.save(human);
103+
humanRepository.save(human);
104104
verify(template).insert(eq(human));
105105
}
106106

@@ -109,25 +109,25 @@ public void shouldSaveUsingInsert() {
109109
public void shouldSaveUsingUpdate() {
110110
Human human = Human.of("Ada-2", 10);
111111
when(template.find(Human.class, "Ada-2")).thenReturn(Optional.of(human));
112-
personRepository.save(human);
112+
humanRepository.save(human);
113113
verify(template).update(eq(human));
114114
}
115115

116116
@Test
117117
public void shouldDelete(){
118-
personRepository.deleteById("id");
118+
humanRepository.deleteById("id");
119119
verify(template).delete(Human.class, "id");
120120
}
121121

122122

123123
@Test
124124
public void shouldDeleteEntity(){
125125
Human human = Human.of("Ada", 10);
126-
personRepository.delete(human);
126+
humanRepository.delete(human);
127127
verify(template).delete(Human.class, human.getName());
128128
}
129129

130-
interface PersonRepository extends CouchbaseRepository<Human, String> {
130+
interface HumanRepository extends CouchbaseRepository<Human, String> {
131131

132132
@N1QL("select * from Person")
133133
List<Human> findAllQuery();

jnosql-dynamodb/src/test/java/org/eclipse/jnosql/databases/dynamodb/mapping/DynamoDBRepositoryProxyTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,22 @@ class DynamoDBRepositoryProxyTest {
5757
@Inject
5858
private Converters converters;
5959

60-
private PersonNoSQLRepository personRepository;
60+
private HumanNoSQLRepository personRepository;
6161

6262
@SuppressWarnings("rawtypes")
6363
@BeforeEach
6464
void setUp() {
6565
this.template = Mockito.mock(DynamoDBTemplate.class);
6666

6767
DynamoDBRepositoryProxy handler = new DynamoDBRepositoryProxy<>(template,
68-
PersonNoSQLRepository.class, converters, entitiesMetadata);
68+
HumanNoSQLRepository.class, converters, entitiesMetadata);
6969

7070
when(template.insert(any(Human.class))).thenReturn(new Human());
7171
when(template.insert(any(Human.class), any(Duration.class))).thenReturn(new Human());
7272
when(template.update(any(Human.class))).thenReturn(new Human());
7373

74-
this.personRepository = (PersonNoSQLRepository) Proxy.newProxyInstance(PersonNoSQLRepository.class.getClassLoader(),
75-
new Class[]{PersonNoSQLRepository.class},
74+
this.personRepository = (HumanNoSQLRepository) Proxy.newProxyInstance(HumanNoSQLRepository.class.getClassLoader(),
75+
new Class[]{HumanNoSQLRepository.class},
7676
handler);
7777
}
7878

@@ -133,7 +133,7 @@ public void shouldDeleteAll() {
133133
Assertions.assertThat(query).isEqualTo(Human.class);
134134
}
135135

136-
interface PersonNoSQLRepository extends DynamoDBRepository<Human, String> {
136+
interface HumanNoSQLRepository extends DynamoDBRepository<Human, String> {
137137

138138
@PartiQL("select * from Person")
139139
List<Human> findAllQuery();

jnosql-hazelcast/src/test/java/org/eclipse/jnosql/databases/hazelcast/mapping/HazelcastRepositoryProxyTest.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public class HazelcastRepositoryProxyTest {
6565
@Inject
6666
private EntitiesMetadata entitiesMetadata;
6767

68-
private PersonRepository personRepository;
68+
private HumanRepository humanRepository;
6969

7070

7171
@SuppressWarnings("rawtypes")
@@ -75,26 +75,26 @@ public void setUp() {
7575
Collection<Object> people = asList(new Human("Poliana", 25), new Human("Otavio", 28));
7676

7777
when(template.sql(anyString())).thenReturn(people);
78-
HazelcastRepositoryProxy handler = new HazelcastRepositoryProxy<>(template, PersonRepository.class, entitiesMetadata);
78+
HazelcastRepositoryProxy handler = new HazelcastRepositoryProxy<>(template, HumanRepository.class, entitiesMetadata);
7979

8080
when(template.sql(anyString(), any(Map.class))).thenReturn(people);
8181

82-
personRepository = (PersonRepository) Proxy.newProxyInstance(PersonRepository.class.getClassLoader(),
83-
new Class[]{PersonRepository.class},
82+
humanRepository = (HumanRepository) Proxy.newProxyInstance(HumanRepository.class.getClassLoader(),
83+
new Class[]{HumanRepository.class},
8484
handler);
8585
}
8686

8787
@Test
8888
public void shouldFindAll() {
89-
List<Human> people = personRepository.findActive();
89+
List<Human> people = humanRepository.findActive();
9090
verify(template).sql("active");
9191
assertNotNull(people);
9292
assertTrue(people.stream().allMatch(Human.class::isInstance));
9393
}
9494

9595
@Test
9696
public void shouldFindByAgeAndInteger() {
97-
Set<Human> people = personRepository.findByAgeAndInteger("Ada", 10);
97+
Set<Human> people = humanRepository.findByAgeAndInteger("Ada", 10);
9898
Map<String, Object> params = new HashMap<>();
9999
params.put("age", 10);
100100
params.put("name", "Ada");
@@ -106,31 +106,31 @@ public void shouldFindByAgeAndInteger() {
106106
@Test
107107
public void shouldSaveUsingInsert() {
108108
Human human = Human.of("Ada", 10);
109-
personRepository.save(human);
109+
humanRepository.save(human);
110110
}
111111

112112

113113
@Test
114114
public void shouldSaveUsingUpdate() {
115115
Human human = Human.of("Ada-2", 10);
116116
when(template.find(Human.class, "Ada-2")).thenReturn(Optional.of(human));
117-
personRepository.save(human);
117+
humanRepository.save(human);
118118
}
119119

120120
@Test
121121
public void shouldDelete(){
122-
personRepository.deleteById("id");
122+
humanRepository.deleteById("id");
123123
}
124124

125125

126126
@Test
127127
public void shouldDeleteEntity(){
128128
Human human = Human.of("Ada", 10);
129-
personRepository.delete(human);
129+
humanRepository.delete(human);
130130
}
131131

132132

133-
interface PersonRepository extends HazelcastRepository<Human, String> {
133+
interface HumanRepository extends HazelcastRepository<Human, String> {
134134

135135
@Query("active")
136136
List<Human> findActive();

jnosql-oracle-nosql/src/test/java/org/eclipse/jnosql/databases/oracle/mapping/OracleDocumentRepositoryProxyTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,21 @@ public class OracleDocumentRepositoryProxyTest {
5959
@Inject
6060
private Converters converters;
6161

62-
private PersonNoSQLRepository personRepository;
62+
private HumanNoSQLRepository personRepository;
6363

6464
@SuppressWarnings("rawtypes")
6565
@BeforeEach
6666
public void setUp() {
6767
this.template = Mockito.mock(OracleNoSQLTemplate.class);
6868

6969
OracleDocumentRepositoryProxy handler = new OracleDocumentRepositoryProxy<>(template,
70-
PersonNoSQLRepository.class, converters, entitiesMetadata);
70+
HumanNoSQLRepository.class, converters, entitiesMetadata);
7171

7272
when(template.insert(any(Human.class))).thenReturn(new Human());
7373
when(template.insert(any(Human.class), any(Duration.class))).thenReturn(new Human());
7474
when(template.update(any(Human.class))).thenReturn(new Human());
75-
this.personRepository = (PersonNoSQLRepository) Proxy.newProxyInstance(PersonNoSQLRepository.class.getClassLoader(),
76-
new Class[]{PersonNoSQLRepository.class},
75+
this.personRepository = (HumanNoSQLRepository) Proxy.newProxyInstance(HumanNoSQLRepository.class.getClassLoader(),
76+
new Class[]{HumanNoSQLRepository.class},
7777
handler);
7878
}
7979

@@ -136,7 +136,7 @@ public void shouldDeleteAll() {
136136
}
137137

138138

139-
interface PersonNoSQLRepository extends OracleNoSQLRepository<Human, String> {
139+
interface HumanNoSQLRepository extends OracleNoSQLRepository<Human, String> {
140140

141141
@SQL("select * from Person")
142142
List<Human> findAllQuery();

0 commit comments

Comments
 (0)