Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Commit b935365

Browse files
committed
fix tests
1 parent 6ac8b39 commit b935365

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

modules/twitch/auth/service/src/test/java/com/funixproductions/api/twitch/auth/service/services/TestTwitchServerTokenService.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.funixproductions.api.twitch.auth.service.clients.TwitchTokenAuthClient;
44
import com.funixproductions.api.twitch.auth.service.dtos.TwitchTokenResponseDTO;
5+
import com.funixproductions.api.twitch.eventsub.client.clients.TwitchEventSubInternalClient;
56
import org.junit.jupiter.api.Test;
67
import org.junit.runner.RunWith;
78
import org.mockito.Mockito;
@@ -12,6 +13,7 @@
1213
import org.springframework.test.context.bean.override.mockito.MockitoBean;
1314

1415
import 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
}

modules/twitch/eventsub/service/src/main/resources/application.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ twitch.eventsub.hmac-secret-key=${TWITCH_EVENTSUB_HMAC_SECRET_KEY}
2929
funixproductions.api.user.app-domain-url=http://user
3030
funixproductions.api.twitch.auth.app-domain-url=http://twitch-auth
3131
funixproductions.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
3436
sentry.dsn=${SENTRY_DSN}

modules/twitch/eventsub/service/src/test/resources/application.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ spring.jpa.hibernate.ddl-auto=create
1313
funixproductions.api.user.app-domain-url=http://user
1414
funixproductions.api.twitch.auth.app-domain-url=http://twitch-auth
1515
funixproductions.api.twitch.reference.app-domain-url=http://twitch-reference
16+
funixproductions.api.twitch.eventsub.app-domain-url=http://twitch-eventsub
1617

1718
#TwitchApi config
1819
twitch.api.app-client-id=clientId

0 commit comments

Comments
 (0)