This repository was archived by the owner on Aug 21, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed
auth/service/src/test/java/com/funixproductions/api/twitch/auth/service/services Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 22
33import com .funixproductions .api .twitch .auth .service .clients .TwitchTokenAuthClient ;
44import com .funixproductions .api .twitch .auth .service .dtos .TwitchTokenResponseDTO ;
5+ import com .funixproductions .api .twitch .eventsub .client .clients .TwitchEventSubInternalClient ;
56import org .junit .jupiter .api .Test ;
67import org .junit .runner .RunWith ;
78import org .mockito .Mockito ;
1213import org .springframework .test .context .bean .override .mockito .MockitoBean ;
1314
1415import static org .junit .jupiter .api .Assertions .assertNotNull ;
16+ import static org .mockito .ArgumentMatchers .anyString ;
1517
1618@ SpringBootTest
1719@ AutoConfigureMockMvc
@@ -24,6 +26,9 @@ class TestTwitchServerTokenService {
2426 @ Autowired
2527 private TwitchServerTokenService twitchServerTokenService ;
2628
29+ @ MockitoBean
30+ private TwitchEventSubInternalClient twitchEventSubInternalClient ;
31+
2732 @ Test
2833 void testFetchingToken () throws Exception {
2934 final TwitchTokenResponseDTO mockToken = new TwitchTokenResponseDTO ();
@@ -38,5 +43,7 @@ void testFetchingToken() throws Exception {
3843
3944 assertNotNull (twitchServerTokenService .getAccessToken ());
4045 assertNotNull (twitchServerTokenService .getExpiresAt ());
46+
47+ Mockito .doNothing ().when (twitchEventSubInternalClient ).createSubscription (anyString ());
4148 }
4249}
Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ twitch.eventsub.hmac-secret-key=${TWITCH_EVENTSUB_HMAC_SECRET_KEY}
2929funixproductions.api.user.app-domain-url =http://user
3030funixproductions.api.twitch.auth.app-domain-url =http://twitch-auth
3131funixproductions.api.twitch.reference.app-domain-url =http://twitch-reference
32+ funixproductions.api.twitch.eventsub.app-domain-url =http://twitch-eventsub
33+
3234
3335# Sentry config
3436sentry.dsn =${SENTRY_DSN}
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ spring.jpa.hibernate.ddl-auto=create
1313funixproductions.api.user.app-domain-url =http://user
1414funixproductions.api.twitch.auth.app-domain-url =http://twitch-auth
1515funixproductions.api.twitch.reference.app-domain-url =http://twitch-reference
16+ funixproductions.api.twitch.eventsub.app-domain-url =http://twitch-eventsub
1617
1718# TwitchApi config
1819twitch.api.app-client-id =clientId
You can’t perform that action at this time.
0 commit comments