Skip to content

Commit 1f7f32c

Browse files
committed
feat: rename to magazine at araongdb
Signed-off-by: Otavio Santana <[email protected]>
1 parent ee33c10 commit 1f7f32c

File tree

3 files changed

+75
-75
lines changed

3 files changed

+75
-75
lines changed

jnosql-arangodb/src/test/java/org/eclipse/jnosql/databases/arangodb/integration/ArangoDBTemplateIntegrationTest.java

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
@EnableAutoWeld
5050
@AddPackages(value = {Database.class, EntityConverter.class, DocumentTemplate.class})
51-
@AddPackages(Book.class)
51+
@AddPackages(Magazine.class)
5252
@AddPackages(ArangoDBTemplate.class)
5353
@AddExtensions({EntityMetadataExtension.class,
5454
DocumentExtension.class})
@@ -68,101 +68,101 @@ class ArangoDBTemplateIntegrationTest {
6868

6969
@BeforeEach
7070
void setUp() {
71-
this.template.delete(Book.class).execute();
71+
this.template.delete(Magazine.class).execute();
7272
}
7373

7474
@Test
7575
void shouldInsert() {
76-
Book book = new Book(randomUUID().toString(), "Effective Java", 1);
77-
template.insert(book);
78-
Optional<Book> optional = template.find(Book.class, book.id());
76+
Magazine magazine = new Magazine(randomUUID().toString(), "Effective Java", 1);
77+
template.insert(magazine);
78+
Optional<Magazine> optional = template.find(Magazine.class, magazine.id());
7979
assertThat(optional).isNotNull().isNotEmpty()
80-
.get().isEqualTo(book);
80+
.get().isEqualTo(magazine);
8181
}
8282

8383
@Test
8484
void shouldUpdate() {
85-
Book book = new Book(randomUUID().toString(), "Effective Java", 1);
86-
assertThat(template.insert(book))
85+
Magazine magazine = new Magazine(randomUUID().toString(), "Effective Java", 1);
86+
assertThat(template.insert(magazine))
8787
.isNotNull()
88-
.isEqualTo(book);
88+
.isEqualTo(magazine);
8989

90-
Book updated = new Book(book.id(), book.title() + " updated", 2);
90+
Magazine updated = new Magazine(magazine.id(), magazine.title() + " updated", 2);
9191

9292
assertThat(template.update(updated))
9393
.isNotNull()
94-
.isNotEqualTo(book);
94+
.isNotEqualTo(magazine);
9595

96-
assertThat(template.find(Book.class, book.id()))
96+
assertThat(template.find(Magazine.class, magazine.id()))
9797
.isNotNull().get().isEqualTo(updated);
9898

9999
}
100100

101101
@Test
102102
void shouldFindById() {
103-
Book book = new Book(randomUUID().toString(), "Effective Java", 1);
104-
assertThat(template.insert(book))
103+
Magazine magazine = new Magazine(randomUUID().toString(), "Effective Java", 1);
104+
assertThat(template.insert(magazine))
105105
.isNotNull()
106-
.isEqualTo(book);
106+
.isEqualTo(magazine);
107107

108-
assertThat(template.find(Book.class, book.id()))
109-
.isNotNull().get().isEqualTo(book);
108+
assertThat(template.find(Magazine.class, magazine.id()))
109+
.isNotNull().get().isEqualTo(magazine);
110110
}
111111

112112
@Test
113113
void shouldDelete() {
114-
Book book = new Book(randomUUID().toString(), "Effective Java", 1);
115-
assertThat(template.insert(book))
114+
Magazine magazine = new Magazine(randomUUID().toString(), "Effective Java", 1);
115+
assertThat(template.insert(magazine))
116116
.isNotNull()
117-
.isEqualTo(book);
117+
.isEqualTo(magazine);
118118

119-
template.delete(Book.class, book.id());
120-
assertThat(template.find(Book.class, book.id()))
119+
template.delete(Magazine.class, magazine.id());
120+
assertThat(template.find(Magazine.class, magazine.id()))
121121
.isNotNull().isEmpty();
122122
}
123123

124124
@Test
125125
void shouldDeleteAll() {
126126
for (int index = 0; index < 20; index++) {
127-
Book book = new Book(randomUUID().toString(), "Effective Java", 1);
128-
assertThat(template.insert(book))
127+
Magazine magazine = new Magazine(randomUUID().toString(), "Effective Java", 1);
128+
assertThat(template.insert(magazine))
129129
.isNotNull()
130-
.isEqualTo(book);
130+
.isEqualTo(magazine);
131131
}
132132

133-
template.delete(Book.class).execute();
134-
assertThat(template.select(Book.class).result()).isEmpty();
133+
template.delete(Magazine.class).execute();
134+
assertThat(template.select(Magazine.class).result()).isEmpty();
135135
}
136136

137137

138138
@Test
139139
void shouldUpdateNullValues() {
140-
var book = new Book(randomUUID().toString(), "Effective Java", 1);
140+
var book = new Magazine(randomUUID().toString(), "Effective Java", 1);
141141
template.insert(book);
142-
template.update(new Book(book.id(), null, 2));
143-
Optional<Book> optional = template.select(Book.class).where("id")
142+
template.update(new Magazine(book.id(), null, 2));
143+
Optional<Magazine> optional = template.select(Magazine.class).where("id")
144144
.eq(book.id()).singleResult();
145145
SoftAssertions.assertSoftly(softly -> {
146146
softly.assertThat(optional).isPresent();
147-
softly.assertThat(optional).get().extracting(Book::title).isNull();
148-
softly.assertThat(optional).get().extracting(Book::edition).isEqualTo(2);
147+
softly.assertThat(optional).get().extracting(Magazine::title).isNull();
148+
softly.assertThat(optional).get().extracting(Magazine::edition).isEqualTo(2);
149149
});
150150
}
151151

152152
@Test
153153
void shouldExecuteLimit() {
154154

155155
for (int index = 1; index < 10; index++) {
156-
var book = new Book(randomUUID().toString(), "Effective Java", index);
156+
var book = new Magazine(randomUUID().toString(), "Effective Java", index);
157157
template.insert(book);
158158
}
159159

160-
List<Book> books = template.select(Book.class).orderBy("edition")
160+
List<Magazine> magazines = template.select(Magazine.class).orderBy("edition")
161161
.asc().limit(4).result();
162162

163163
SoftAssertions.assertSoftly(soft -> {
164-
soft.assertThat(books).hasSize(4);
165-
var editions = books.stream().map(Book::edition).toList();
164+
soft.assertThat(magazines).hasSize(4);
165+
var editions = magazines.stream().map(Magazine::edition).toList();
166166
soft.assertThat(editions).hasSize(4).contains(1, 2, 3, 4);
167167
});
168168

@@ -171,52 +171,52 @@ void shouldExecuteLimit() {
171171
@Test
172172
void shouldExecuteSkip() {
173173
for (int index = 1; index < 10; index++) {
174-
var book = new Book(randomUUID().toString(), "Effective Java", index);
174+
var book = new Magazine(randomUUID().toString(), "Effective Java", index);
175175
template.insert(book);
176176
}
177177

178-
List<Book> books = template.select(Book.class).orderBy("edition")
178+
List<Magazine> magazines = template.select(Magazine.class).orderBy("edition")
179179
.asc().skip(4).result();
180180

181181
SoftAssertions.assertSoftly(soft -> {
182-
soft.assertThat(books).hasSize(5);
183-
var editions = books.stream().map(Book::edition).toList();
182+
soft.assertThat(magazines).hasSize(5);
183+
var editions = magazines.stream().map(Magazine::edition).toList();
184184
soft.assertThat(editions).hasSize(5).contains(5, 6, 7, 8, 9);
185185
});
186186
}
187187

188188
@Test
189189
void shouldExecuteLimitStart() {
190190
for (int index = 1; index < 10; index++) {
191-
var book = new Book(randomUUID().toString(), "Effective Java", index);
191+
var book = new Magazine(randomUUID().toString(), "Effective Java", index);
192192
template.insert(book);
193193
}
194194

195-
List<Book> books = template.select(Book.class).orderBy("edition")
195+
List<Magazine> magazines = template.select(Magazine.class).orderBy("edition")
196196
.asc().skip(4).limit(3).result();
197197

198198
SoftAssertions.assertSoftly(soft -> {
199-
soft.assertThat(books).hasSize(3);
200-
var editions = books.stream().map(Book::edition).toList();
199+
soft.assertThat(magazines).hasSize(3);
200+
var editions = magazines.stream().map(Magazine::edition).toList();
201201
soft.assertThat(editions).hasSize(3).contains(5, 6, 7);
202202
});
203203
}
204204

205205
@Test
206206
void shouldSelectCursorSize() {
207207
for (int index = 1; index < 10; index++) {
208-
var book = new Book(randomUUID().toString(), "Effective Java", index);
208+
var book = new Magazine(randomUUID().toString(), "Effective Java", index);
209209
template.insert(book);
210210
}
211211
var select = SelectQuery.select().from("Book").orderBy("edition").asc()
212212
.skip(4).limit(3).build();
213213
var pageRequest = PageRequest.ofSize(3);
214-
CursoredPage<Book> entities = template.selectCursor(select, pageRequest);
214+
CursoredPage<Magazine> entities = template.selectCursor(select, pageRequest);
215215

216216
SoftAssertions.assertSoftly(soft -> {
217217
var content = entities.content();
218218
soft.assertThat(content).hasSize(3);
219-
var editions = content.stream().map(Book::edition).toList();
219+
var editions = content.stream().map(Magazine::edition).toList();
220220
soft.assertThat(editions).hasSize(3).contains(1, 2, 3);
221221
});
222222
}

jnosql-arangodb/src/test/java/org/eclipse/jnosql/databases/arangodb/integration/Book.java renamed to jnosql-arangodb/src/test/java/org/eclipse/jnosql/databases/arangodb/integration/Magazine.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import java.util.Objects;
2222

2323
@Entity
24-
public class Book {
24+
public class Magazine {
2525

2626
@Id("_key")
2727
private String id;
@@ -32,13 +32,13 @@ public class Book {
3232
@Column("edition")
3333
private int edition;
3434

35-
public Book(String id, String title, int edition) {
35+
public Magazine(String id, String title, int edition) {
3636
this.id = id;
3737
this.title = title;
3838
this.edition = edition;
3939
}
4040

41-
Book() {
41+
Magazine() {
4242
}
4343

4444
public String id() {
@@ -57,10 +57,10 @@ public int edition() {
5757
public boolean equals(Object o) {
5858
if (this == o) return true;
5959
if (o == null || getClass() != o.getClass()) return false;
60-
Book book = (Book) o;
61-
return edition == book.edition
62-
&& Objects.equals(id, book.id)
63-
&& Objects.equals(title, book.title);
60+
Magazine magazine = (Magazine) o;
61+
return edition == magazine.edition
62+
&& Objects.equals(id, magazine.id)
63+
&& Objects.equals(title, magazine.title);
6464
}
6565

6666
@Override

jnosql-arangodb/src/test/java/org/eclipse/jnosql/databases/arangodb/integration/TemplateIntegrationTest.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
@EnableAutoWeld
4747
@AddPackages(value = {Database.class, EntityConverter.class, DocumentTemplate.class})
48-
@AddPackages(Book.class)
48+
@AddPackages(Magazine.class)
4949
@AddExtensions({EntityMetadataExtension.class,
5050
DocumentExtension.class})
5151
@AddPackages(Reflections.class)
@@ -65,51 +65,51 @@ class TemplateIntegrationTest {
6565

6666
@Test
6767
void shouldInsert() {
68-
Book book = new Book(randomUUID().toString(), "Effective Java", 1);
69-
template.insert(book);
70-
Optional<Book> optional = template.find(Book.class, book.id());
68+
Magazine magazine = new Magazine(randomUUID().toString(), "Effective Java", 1);
69+
template.insert(magazine);
70+
Optional<Magazine> optional = template.find(Magazine.class, magazine.id());
7171
assertThat(optional).isNotNull().isNotEmpty()
72-
.get().isEqualTo(book);
72+
.get().isEqualTo(magazine);
7373
}
7474

7575
@Test
7676
void shouldUpdate() {
77-
Book book = new Book(randomUUID().toString(), "Effective Java", 1);
78-
assertThat(template.insert(book))
77+
Magazine magazine = new Magazine(randomUUID().toString(), "Effective Java", 1);
78+
assertThat(template.insert(magazine))
7979
.isNotNull()
80-
.isEqualTo(book);
80+
.isEqualTo(magazine);
8181

82-
Book updated = new Book(book.id(), book.title() + " updated", 2);
82+
Magazine updated = new Magazine(magazine.id(), magazine.title() + " updated", 2);
8383

8484
assertThat(template.update(updated))
8585
.isNotNull()
86-
.isNotEqualTo(book);
86+
.isNotEqualTo(magazine);
8787

88-
assertThat(template.find(Book.class, book.id()))
88+
assertThat(template.find(Magazine.class, magazine.id()))
8989
.isNotNull().get().isEqualTo(updated);
9090

9191
}
9292

9393
@Test
9494
void shouldFindById() {
95-
Book book = new Book(randomUUID().toString(), "Effective Java", 1);
96-
assertThat(template.insert(book))
95+
Magazine magazine = new Magazine(randomUUID().toString(), "Effective Java", 1);
96+
assertThat(template.insert(magazine))
9797
.isNotNull()
98-
.isEqualTo(book);
98+
.isEqualTo(magazine);
9999

100-
assertThat(template.find(Book.class, book.id()))
101-
.isNotNull().get().isEqualTo(book);
100+
assertThat(template.find(Magazine.class, magazine.id()))
101+
.isNotNull().get().isEqualTo(magazine);
102102
}
103103

104104
@Test
105105
void shouldDelete() {
106-
Book book = new Book(randomUUID().toString(), "Effective Java", 1);
107-
assertThat(template.insert(book))
106+
Magazine magazine = new Magazine(randomUUID().toString(), "Effective Java", 1);
107+
assertThat(template.insert(magazine))
108108
.isNotNull()
109-
.isEqualTo(book);
109+
.isEqualTo(magazine);
110110

111-
template.delete(Book.class, book.id());
112-
assertThat(template.find(Book.class, book.id()))
111+
template.delete(Magazine.class, magazine.id());
112+
assertThat(template.find(Magazine.class, magazine.id()))
113113
.isNotNull().isEmpty();
114114
}
115115

0 commit comments

Comments
 (0)