Skip to content

Commit 2c5a991

Browse files
committed
remove test prefix
1 parent 24489e4 commit 2c5a991

File tree

7 files changed

+36
-36
lines changed

7 files changed

+36
-36
lines changed

srv/src/test/java/my/bookshop/AdminServiceTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ class AdminServiceTest {
3131

3232
@Test
3333
@WithMockUser(username = "user")
34-
void testUnauthorizedAccess() {
34+
void unauthorizedAccess() {
3535
assertThrows(ServiceException.class, () -> {
3636
adminService.newDraft(Insert.into(AUTHORS).entry(Collections.emptyMap()));
3737
});
3838
}
3939

4040
@Test
4141
@WithMockUser(username = "admin")
42-
void testInvalidAuthorName() {
42+
void invalidAuthorName() {
4343
assertThrows(ServiceException.class, () -> {
4444
Authors author = Authors.create();
4545
author.setName("little Joey");
@@ -49,7 +49,7 @@ void testInvalidAuthorName() {
4949

5050
@Test
5151
@WithMockUser(username = "admin")
52-
void testValidAuthorName() {
52+
void validAuthorName() {
5353
Authors author = Authors.create();
5454
author.setName("Big Joey");
5555
Result result = adminService.run(Insert.into(AUTHORS).entry(author));
@@ -58,7 +58,7 @@ void testValidAuthorName() {
5858

5959
@Test
6060
@WithMockUser(username = "admin")
61-
void testCreateOrderWithoutBook() {
61+
void createOrderWithoutBook() {
6262
Orders order = Orders.create();
6363
order.setOrderNo("324");
6464
order.setShippingAddressId("100");
@@ -75,7 +75,7 @@ void testCreateOrderWithoutBook() {
7575

7676
@Test
7777
@WithMockUser(username = "admin")
78-
void testCreateOrderWithNonExistingBook() {
78+
void createOrderWithNonExistingBook() {
7979
Orders order = Orders.create();
8080
order.setOrderNo("324");
8181
order.setShippingAddressId("100");

srv/src/test/java/my/bookshop/CatalogServiceITest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,29 +44,29 @@ void cleanup() {
4444
}
4545

4646
@Test
47-
void testDiscountApplied() throws Exception {
47+
void discountApplied() throws Exception {
4848
mockMvc.perform(get(booksURI + "?$filter=stock gt 200&top=1"))
4949
.andExpect(status().isOk())
5050
.andExpect(jsonPath("$.value[0].title").value(containsString("11% discount")));
5151
}
5252

5353
@Test
54-
void testDiscountNotApplied() throws Exception {
54+
void discountNotApplied() throws Exception {
5555
mockMvc.perform(get(booksURI + "?$filter=stock lt 100&top=1"))
5656
.andExpect(status().isOk())
5757
.andExpect(jsonPath("$.value[0].title").value(not(containsString("11% discount"))));
5858
}
5959

6060
@Test
61-
void testCreateReviewNotAuthenticated() throws Exception {
61+
void createReviewNotAuthenticated() throws Exception {
6262
String payload = createTestReview().toJson();
6363
mockMvc.perform(post(addReviewURI).contentType(MediaType.APPLICATION_JSON).content(payload))
6464
.andExpect(status().isUnauthorized());
6565
}
6666

6767
@Test
6868
@WithMockUser(USER_USER_STRING)
69-
void testCreateReviewByUser() throws Exception {
69+
void createReviewByUser() throws Exception {
7070
String payload = createTestReview().toJson();
7171
mockMvc.perform(post(addReviewURI).contentType(MediaType.APPLICATION_JSON).content(payload))
7272
.andExpect(status().isOk())
@@ -75,7 +75,7 @@ void testCreateReviewByUser() throws Exception {
7575

7676
@Test
7777
@WithMockUser(ADMIN_USER_STRING)
78-
void testCreateReviewByAdmin() throws Exception {
78+
void createReviewByAdmin() throws Exception {
7979
String payload = createTestReview().toJson();
8080
mockMvc.perform(post(addReviewURI).contentType(MediaType.APPLICATION_JSON).content(payload))
8181
.andExpect(status().isOk())

srv/src/test/java/my/bookshop/CatalogServiceTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void cleanup() {
3939

4040
@Test
4141
@WithMockUser(username = "user")
42-
void testCreateReviewHandler() {
42+
void createReviewHandler() {
4343
Stream<Reviews> bookReviews = Stream.of(
4444
createReview("f846b0b9-01d4-4f6d-82a4-d79204f62278", 1, "quite bad", "disappointing..."),
4545
createReview("aebdfc8a-0dfa-4468-bd36-48aabd65e663", 5, "great read", "just amazing..."));
@@ -58,7 +58,7 @@ void testCreateReviewHandler() {
5858

5959
@Test
6060
@WithMockUser(username = "user")
61-
void testAddReviewWithInvalidRating() {
61+
void addReviewWithInvalidRating() {
6262
Stream<Reviews> bookReviews = Stream.of(
6363
// lt 1 is invalid
6464
createReview("f846b0b9-01d4-4f6d-82a4-d79204f62278", 0, "quite bad", "disappointing..."),
@@ -76,7 +76,7 @@ void testAddReviewWithInvalidRating() {
7676

7777
@Test
7878
@WithMockUser(username = "user")
79-
void testAddReviewForNonExistingBook() {
79+
void addReviewForNonExistingBook() {
8080

8181
String nonExistingBookId = "non-existing";
8282
String exMessage1 = "You have to specify the book to review";
@@ -98,7 +98,7 @@ void testAddReviewForNonExistingBook() {
9898

9999
@Test
100100
@WithMockUser(username = "user")
101-
void testAddReviewSameBookMoreThanOnceBySameUser() {
101+
void addReviewSameBookMoreThanOnceBySameUser() {
102102

103103
String bookId = "4a519e61-3c3a-4bd9-ab12-d7e0c5329933";
104104
Books_ ref = CQL.entity(BOOKS).filter(b -> b.ID().eq(bookId));

srv/src/test/java/my/bookshop/GenreHierarchyTest.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ class GenreHierarchyTest {
2525

2626
@Test
2727
@WithMockUser(username = "admin")
28-
void testGetAll() throws Exception {
28+
void getAll() throws Exception {
2929
client.perform(get(genresURI)).andExpect(status().isOk());
3030
}
3131

3232
@Test
3333
@WithMockUser(username = "admin")
34-
void testCountAll() throws Exception {
34+
void countAll() throws Exception {
3535
client.perform(get(genresURI + "/$count"))
3636
.andExpect(status().isOk())
3737
.andExpect(jsonPath("$").value(269));
3838
}
3939

4040
@Test
4141
@WithMockUser(username = "admin")
42-
void testStartOneLevel() throws Exception {
42+
void startOneLevel() throws Exception {
4343
client.perform(get(genresURI
4444
+ "?$select=DrillState,ID,name,DistanceFromRoot"
4545
+ "&$apply=orderby(name)/"
@@ -59,7 +59,7 @@ void testStartOneLevel() throws Exception {
5959

6060
@Test
6161
@WithMockUser(username = "admin")
62-
void testStartTwoLevels() throws Exception {
62+
void startTwoLevels() throws Exception {
6363
client.perform(get(genresURI
6464
+ "?$select=DrillState,ID,name,DistanceFromRoot"
6565
+ "&$apply=orderby(name)/"
@@ -80,7 +80,7 @@ void testStartTwoLevels() throws Exception {
8080

8181
@Test
8282
@WithMockUser(username = "admin")
83-
void testExpandNonFiction() throws Exception {
83+
void expandNonFiction() throws Exception {
8484
client.perform(get(genresURI
8585
+ "?$select=DrillState,ID,name"
8686
+ "&$apply=descendants($root/GenreHierarchy,GenreHierarchy,ID,filter(ID eq 8bbf14c6-b378-4e35-9b4f-05a9c8878021),1)"
@@ -93,7 +93,7 @@ void testExpandNonFiction() throws Exception {
9393

9494
@Test
9595
@WithMockUser(username = "admin")
96-
void testCollapseAll() throws Exception {
96+
void collapseAll() throws Exception {
9797
client.perform(get(genresURI
9898
+ "?$select=DrillState,ID,name"
9999
+ "&$apply=orderby(name)/com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchy',NodeProperty='ID',Levels=1)"
@@ -108,7 +108,7 @@ void testCollapseAll() throws Exception {
108108

109109
@Test
110110
@WithMockUser(username = "admin")
111-
void testExpandAllTop100() throws Exception {
111+
void expandAllTop100() throws Exception {
112112
String url = genresURI
113113
+ "?$select=DistanceFromRoot,DrillState,ID,LimitedDescendantCount,name"
114114
+ "&$apply=orderby(name)/com.sap.vocabularies.Hierarchy.v1.TopLevels(HierarchyNodes=$root/GenreHierarchy,HierarchyQualifier='GenreHierarchy',NodeProperty='ID')"
@@ -126,7 +126,7 @@ void testExpandAllTop100() throws Exception {
126126

127127
@Test
128128
@WithMockUser(username = "admin")
129-
void testSearch() throws Exception {
129+
void search() throws Exception {
130130
client.perform(get(genresURI
131131
+ "?$select=DistanceFromRoot,DrillState,ID,LimitedDescendantCount,name"
132132
+ "&$apply=ancestors($root/GenreHierarchy,GenreHierarchy,ID,search(\"true\"),keep start)"
@@ -154,7 +154,7 @@ void testSearch() throws Exception {
154154

155155
@Test
156156
@WithMockUser(username = "admin")
157-
void testFilterNotExpanded() throws Exception {
157+
void filterNotExpanded() throws Exception {
158158
client.perform(get(genresURI
159159
+ "?$select=DrillState,ID,name,DistanceFromRoot"
160160
+ "&$apply=ancestors($root/GenreHierarchy,GenreHierarchy,ID,filter(name eq 'Autobiography'),keep start)/orderby(name)"
@@ -168,7 +168,7 @@ void testFilterNotExpanded() throws Exception {
168168

169169
@Test
170170
@WithMockUser(username = "admin")
171-
void testFilterExpandLevels() throws Exception {
171+
void filterExpandLevels() throws Exception {
172172
String expandLevelsJson = """
173173
[{"NodeID":"8bbf14c6-b378-4e35-9b4f-05a9c8878002","Levels":1},{"NodeID":"8bbf14c6-b378-4e35-9b4f-05a9c8878031","Levels":1}]\
174174
""";
@@ -188,7 +188,7 @@ void testFilterExpandLevels() throws Exception {
188188

189189
@Test
190190
@WithMockUser(username = "admin")
191-
void testStartTwoLevelsOrderByDesc() throws Exception {
191+
void startTwoLevelsOrderByDesc() throws Exception {
192192
client.perform(get(genresURI
193193
+ "?$select=DrillState,ID,name,DistanceFromRoot"
194194
+ "&$apply=orderby(name desc)/"

srv/src/test/java/my/bookshop/NotesServiceITest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class NotesServiceITest {
2020
private WebTestClient client;
2121

2222
@Test
23-
void testGetNotes() {
23+
void getNotes() {
2424
client.get().uri(notesURI).headers(this::authenticatedCredentials).exchange()
2525
.expectStatus().isOk()
2626
.expectBody()
@@ -40,7 +40,7 @@ void testGetNotes() {
4040
}
4141

4242
@Test
43-
void testGetAddresses() {
43+
void getAddresses() {
4444
client.get().uri(addressesURI + "?$filter=businessPartner eq '10401010'").headers(this::authenticatedCredentials).exchange()
4545
.expectStatus().isOk()
4646
.expectBody()
@@ -54,7 +54,7 @@ void testGetAddresses() {
5454
}
5555

5656
@Test
57-
void testGetNoteWithAddress() {
57+
void getNoteWithAddress() {
5858
client.get().uri(notesURI + "?$expand=address").headers(this::authenticatedCredentials).exchange()
5959
.expectStatus().isOk()
6060
.expectBody()
@@ -83,7 +83,7 @@ void testGetNoteWithAddress() {
8383
}
8484

8585
@Test
86-
void testGetSuppliersWithNotes() {
86+
void getSuppliersWithNotes() {
8787
client.get().uri(addressesURI + "?$expand=notes($orderby=ID)&$filter=businessPartner eq '10401010'").headers(this::authenticatedCredentials).exchange()
8888
.expectStatus().isOk()
8989
.expectBody()
@@ -108,7 +108,7 @@ void testGetSuppliersWithNotes() {
108108
}
109109

110110
@Test
111-
void testGetNotesToSupplier() {
111+
void getNotesToSupplier() {
112112
client.get().uri(notesURI + "(ID=5efc842c-c70d-4ee2-af1d-81c7d257aff7,IsActiveEntity=true)/address").headers(this::authenticatedCredentials).exchange()
113113
.expectStatus().isOk()
114114
.expectBody()
@@ -119,7 +119,7 @@ void testGetNotesToSupplier() {
119119
}
120120

121121
@Test
122-
void testGetSupplierToNotes() {
122+
void getSupplierToNotes() {
123123
client.get().uri(addressesURI + "(businessPartner='10401010',ID='100')/notes").headers(this::authenticatedCredentials).exchange()
124124
.expectStatus().isOk()
125125
.expectBody()
@@ -135,7 +135,7 @@ void testGetSupplierToNotes() {
135135
}
136136

137137
@Test
138-
void testGetSupplierToSpecificNote() {
138+
void getSupplierToSpecificNote() {
139139
client.get().uri(addressesURI + "(businessPartner='10401010',ID='100')/notes(ID=83e2643b-aecc-47d3-9f85-a8ba14eff07d,IsActiveEntity=true)")
140140
.headers(this::authenticatedCredentials)
141141
.exchange()
@@ -148,7 +148,7 @@ void testGetSupplierToSpecificNote() {
148148
}
149149

150150
@Test
151-
void testGetNotesWithNestedExpands() {
151+
void getNotesWithNestedExpands() {
152152
client.get().uri(notesURI + "?$select=note&$expand=address($select=postalCode;$expand=notes($select=note))&$top=1").headers(this::authenticatedCredentials).exchange()
153153
.expectStatus().isOk()
154154
.expectBody()
@@ -164,7 +164,7 @@ void testGetNotesWithNestedExpands() {
164164
}
165165

166166
@Test
167-
void testGetAddressesWithNestedExpands() {
167+
void getAddressesWithNestedExpands() {
168168
client.get().uri(addressesURI + "?$select=postalCode&$expand=notes($select=note;$expand=address($select=postalCode))&$filter=businessPartner eq '1000020'")
169169
.headers(this::authenticatedCredentials)
170170
.exchange()

srv/src/test/java/my/bookshop/RatingCalculatorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ private static class RatingTestFixture {
2323
}
2424

2525
@Test
26-
void testGetAvgRating() {
26+
void getAvgRating() {
2727
RatingTestFixture f1 = new RatingTestFixture(Stream.of(1.0, 2.0, 3.0, 4.0, 5.0), 3.0);
2828
RatingTestFixture f2 = new RatingTestFixture(Stream.of(1.3, 2.4, 3.5, 4.9, 5.1), 3.4);
2929
RatingTestFixture f3 = new RatingTestFixture(Stream.of(2.1, 4.0, 2.7, 3.8, 4.9), 3.5);

srv/src/test/java/my/bookshop/handlers/CatalogServiceHandlerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
class CatalogServiceHandlerTest {
1414

1515
@Test
16-
void testDiscountHandler() {
16+
void discountHandler() {
1717
Books book1 = Books.create();
1818
book1.setTitle("Book 1");
1919
book1.setStock(10);

0 commit comments

Comments
 (0)