generated from digitalservicebund/java-application-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(receiver): Add endpoint for callback
- Loading branch information
1 parent
597f7cf
commit 3485cc7
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/de/bund/digitalservice/a2j/controller/ReceiverController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package de.bund.digitalservice.a2j.controller; | ||
|
||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class ReceiverController { | ||
|
||
public ReceiverController() {} | ||
; | ||
|
||
@PostMapping("callbacks/fit-connect") | ||
public void newSubmission() { | ||
System.out.println("new Submission via callback!"); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/test/java/de/bund/digitalservice/a2j/integration/ReceiverIntegrationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package de.bund.digitalservice.a2j.integration; | ||
|
||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; | ||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; | ||
|
||
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.test.web.servlet.MockMvc; | ||
|
||
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) | ||
@AutoConfigureMockMvc | ||
@Tag("integration") | ||
public class ReceiverIntegrationTest { | ||
@Autowired private MockMvc mockMvc; | ||
|
||
@Test | ||
void shouldExposeSecurityTxt() throws Exception { | ||
mockMvc.perform(post("/callbacks/fit-connect")).andExpect(status().isOk()); | ||
} | ||
} |