Skip to content

Commit

Permalink
Fix(test): Mock subscriber client
Browse files Browse the repository at this point in the history
  • Loading branch information
zechmeister committed Oct 29, 2024
1 parent 264c05e commit 514265d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ lefthook-local.yml
.DS_Store

### fit-connect ###
application-local.yaml
signing_key.json
decryption_key.json
application-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import dev.fitko.fitconnect.client.SubscriberClient;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.web.servlet.MockMvc;

@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@AutoConfigureMockMvc
@Tag("integration")
public class ReceiverIntegrationTest {
@Autowired private MockMvc mockMvc;
@MockBean SubscriberClient subscriberClient;

@Test
void shouldSecureCallbackWithoutAuthorization() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import dev.fitko.fitconnect.client.SubscriberClient;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MockMvc;

Expand All @@ -20,6 +22,7 @@
class SecurityTxtIntegrationTest {

@Autowired private MockMvc mockMvc;
@MockBean SubscriberClient subscriberClient;

@Test
void shouldExposeSecurityTxt() throws Exception {
Expand Down

0 comments on commit 514265d

Please sign in to comment.