Skip to content

Commit b79f1b7

Browse files
committed
use default naming strategy for parameterized tests
1 parent e60e334 commit b79f1b7

8 files changed

Lines changed: 20 additions & 20 deletions

File tree

src/integrationTest/java/com/trynoice/api/identity/AccountControllerTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class AccountControllerTest {
7474
@MockBean
7575
private SignInTokenDispatchStrategy signInTokenDispatchStrategy;
7676

77-
@ParameterizedTest(name = "{displayName} - email={0} name={1} responseStatus={2} expectingSignInTokenDispatch={3}")
77+
@ParameterizedTest
7878
@MethodSource("signUpTestCases")
7979
void signUp(String email, String name, int expectedResponseStatus, boolean isExpectingSignInTokenDispatch) throws Exception {
8080
doNothing()
@@ -113,7 +113,7 @@ static Stream<Arguments> signUpTestCases() {
113113
);
114114
}
115115

116-
@ParameterizedTest(name = "{displayName} - email={0} responseStatus={1} expectingSignInTokenDispatch={2}")
116+
@ParameterizedTest
117117
@MethodSource("signInTestCases")
118118
void signIn(String email, int expectedResponseStatus, boolean isExpectingSignInTokenDispatch) throws Exception {
119119
// create auth user for test-cases that expect it.
@@ -158,7 +158,7 @@ static Stream<Arguments> signInTestCases() {
158158
);
159159
}
160160

161-
@ParameterizedTest(name = "{displayName} - tokenType={0} responseStatus={1}")
161+
@ParameterizedTest
162162
@MethodSource("signOutTestCases")
163163
void signOut_withHeader(JwtType tokenType, int expectedResponseStatus) throws Exception {
164164
// create signed refresh-tokens as expected by various test cases.
@@ -182,7 +182,7 @@ void signOut_withHeader(JwtType tokenType, int expectedResponseStatus) throws Ex
182182
}
183183
}
184184

185-
@ParameterizedTest(name = "{displayName} - tokenType={0} responseStatus={1}")
185+
@ParameterizedTest
186186
@MethodSource("signOutTestCases")
187187
void signOut_withCookie(JwtType tokenType, int expectedResponseStatus) throws Exception {
188188
// create signed refresh-tokens as expected by various test cases.
@@ -218,7 +218,7 @@ static Stream<Arguments> signOutTestCases() {
218218
);
219219
}
220220

221-
@ParameterizedTest(name = "{displayName} - tokenType={0} userAgent={1} responseStatus={2}")
221+
@ParameterizedTest
222222
@MethodSource("issueCredentialsTestCases")
223223
void issueCredentials(JwtType tokenType, String userAgent, int expectedResponseStatus) throws Exception {
224224
// create signed refresh-tokens as expected by various test cases.
@@ -256,7 +256,7 @@ static Stream<Arguments> issueCredentialsTestCases() {
256256
);
257257
}
258258

259-
@ParameterizedTest(name = "{displayName} - incompleteSignInAttempts={0} lastSignInAttemptAt={1} responseStatus={2}")
259+
@ParameterizedTest
260260
@MethodSource("emailBlacklistingTestCases")
261261
void emailBlacklisting(int incompleteSignInAttempts, OffsetDateTime lastSignInAttemptAt, int expectedResponseStatus) throws Exception {
262262
val user = createAuthUser(entityManager);
@@ -308,7 +308,7 @@ void getProfile() throws Exception {
308308
assertEquals(authUser.getEmail(), profile.findValue("email").asText());
309309
}
310310

311-
@ParameterizedTest(name = "{displayName} - updatedName={0} updatedEmail={1} responseStatus={2}")
311+
@ParameterizedTest
312312
@MethodSource("updateProfileTestCases")
313313
void updateProfile(String updatedName, String updatedEmail, int expectedResponseStatus) throws Exception {
314314
val authUser = createAuthUser(entityManager);

src/integrationTest/java/com/trynoice/api/identity/BearerTokenAuthFilterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class BearerTokenAuthFilterTest {
3636
@Autowired
3737
private MockMvc mockMvc;
3838

39-
@ParameterizedTest(name = "{displayName} - tokenType={0} requestPath={1} responseStatus={2}")
39+
@ParameterizedTest
4040
@MethodSource("authTestCases")
4141
void auth(JwtType tokenType, String requestPath, int responseStatus) throws Exception {
4242
val authUser = createAuthUser(entityManager);

src/integrationTest/java/com/trynoice/api/identity/CookieAuthFilterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class CookieAuthFilterTest {
4242
@Autowired
4343
private MockMvc mockMvc;
4444

45-
@ParameterizedTest(name = "{displayName} - refresh={0} access={1} path={2} responseStatus={3} expectingNewCookies={4}")
45+
@ParameterizedTest
4646
@MethodSource("authTestCases")
4747
void doFilter(
4848
JwtType refreshTokenType,

src/integrationTest/java/com/trynoice/api/sound/SoundControllerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class SoundControllerTest {
5656
@Autowired
5757
private MockMvc mockMvc;
5858

59-
@ParameterizedTest(name = "{displayName} - isSignedIn={0} isSubscribed={1} isPaymentPending={2} responseStatus={3}")
59+
@ParameterizedTest
6060
@MethodSource("authorizeSegmentRequestTestCases")
6161
void authorizeSegmentRequest(
6262
boolean isSignedIn,

src/integrationTest/java/com/trynoice/api/subscription/SubscriptionControllerTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public class SubscriptionControllerTest {
107107
@Autowired
108108
private MockMvc mockMvc;
109109

110-
@ParameterizedTest(name = "{displayName} - provider={0} responseStatus={1}")
110+
@ParameterizedTest
111111
@MethodSource("listPlansTestCases")
112112
void listPlans(String provider, int expectedResponseStatus) throws Exception {
113113
val request = get("/v1/subscriptions/plans");
@@ -142,7 +142,7 @@ static Stream<Arguments> listPlansTestCases() {
142142
);
143143
}
144144

145-
@ParameterizedTest(name = "{displayName} - provider={0} wasSubscriptionActive={1} expectedResponseStatus={2}")
145+
@ParameterizedTest
146146
@MethodSource("createSubscriptionTestCases")
147147
void createSubscription(
148148
@NonNull SubscriptionPlan.Provider provider,
@@ -328,7 +328,7 @@ private ResultActions doGetSubscriptionRequest(String accessToken, long subscrip
328328
.header("Authorization", "Bearer " + accessToken));
329329
}
330330

331-
@ParameterizedTest(name = "{displayName} - provider={0} isSubscriptionActive={1} expectedResponseStatus={2}")
331+
@ParameterizedTest
332332
@MethodSource("cancelSubscriptionTestCases")
333333
void cancelSubscription(
334334
@NonNull SubscriptionPlan.Provider provider,
@@ -380,7 +380,7 @@ static Stream<Arguments> cancelSubscriptionTestCases() {
380380
);
381381
}
382382

383-
@ParameterizedTest(name = "{displayName} - session.status={0} session.paymentStatus={1} isSubscriptionActive={2}")
383+
@ParameterizedTest
384384
@MethodSource("handleStripeWebhookEvent_checkoutSessionCompleteTestCases")
385385
void handleStripeWebhookEvent_checkoutSessionComplete(
386386
@NonNull String sessionStatus,
@@ -422,7 +422,7 @@ static Stream<Arguments> handleStripeWebhookEvent_checkoutSessionCompleteTestCas
422422
);
423423
}
424424

425-
@ParameterizedTest(name = "{displayName} - stripeStatus={0} isSubscriptionActive={3} isPaymentPending={4}")
425+
@ParameterizedTest
426426
@MethodSource("handleStripeWebhookEvent_subscriptionEventsTestCases")
427427
void handleStripeWebhookEvent_subscriptionEvents(
428428
@NonNull String stripeSubscriptionStatus,
@@ -550,7 +550,7 @@ void handleStripeWebhookEvent_customerDeletedEvent() throws Exception {
550550
assertNull(customerRepository.findById(authUser.getId()).orElseThrow().getStripeId());
551551
}
552552

553-
@ParameterizedTest(name = "{displayName} - exists={0} owned={1} expectedResponseStatus={2}")
553+
@ParameterizedTest
554554
@MethodSource("getGiftCardTestCases")
555555
void getGiftCard(boolean exists, Boolean owned, int expectedResponseStatus) throws Exception {
556556
val code = "test-gift-card-1";
@@ -577,7 +577,7 @@ static Stream<Arguments> getGiftCardTestCases() {
577577
);
578578
}
579579

580-
@ParameterizedTest(name = "{displayName} - exists={0} owned={1} redeemed={2} expired={3} subscribed={4} expectedResponseStatus={5}")
580+
@ParameterizedTest
581581
@MethodSource("redeemGiftCardTestCases")
582582
void redeemGiftCard(
583583
boolean exists,

src/integrationTest/java/com/trynoice/api/subscription/SubscriptionServiceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class SubscriptionServiceTest {
5252
@Autowired
5353
private SubscriptionService service;
5454

55-
@ParameterizedTest(name = "{displayName} - expectedIsActive={3} expectedIsPaymentPending={4}")
55+
@ParameterizedTest
5656
@MethodSource("handleGooglePlayWebhookEventTestCases")
5757
void handleGooglePlayWebhookEvent(
5858
@NonNull GooglePlaySubscriptionPurchase purchase,

src/test/java/com/trynoice/api/sound/SoundServiceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void setUp() {
4343
service = new SoundService(soundConfig, libraryManifestRepository, subscriptionServiceContract);
4444
}
4545

46-
@ParameterizedTest(name = "{displayName} - isSubscribed={1} isRequestingPremiumSegment={2} requestedAudioBitrate={3} hasAccess={4}")
46+
@ParameterizedTest
4747
@MethodSource("authorizeSegmentRequestTestCases")
4848
void authorizeSegmentRequest(
4949
Long principalId,

src/test/java/com/trynoice/api/subscription/SubscriptionServiceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ void getSubscription() {
281281
// skipped unit tests, wrote integration tests instead.
282282
}
283283

284-
@ParameterizedTest(name = "{displayName} #{index}")
284+
@ParameterizedTest
285285
@MethodSource("cancelSubscriptionTestCases")
286286
<T extends Throwable> void cancelSubscription(
287287
@NonNull Subscription subscription,

0 commit comments

Comments
 (0)