Created
October 2, 2019 07:03
-
-
Save mengjiann/0fb358def60fca2194394333a6df6659 to your computer and use it in GitHub Desktop.
Springboot - WebMvcTest
This file contains hidden or 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
@RunWith(SpringRunner.class) | |
@WebMvcTest(EntrySubmitRestController.class) | |
@ContextConfiguration(classes = EntrySubmitRestControllerTest.ContextConfiguration.class) | |
public class EntrySubmitRestControllerTest { | |
@TestConfiguration | |
static class ContextConfiguration { | |
@Bean | |
@Qualifier("entrySubmitDueDate") | |
public LocalDate getEntrySubmitDueDate(){ | |
return LocalDate.now().plusDays(1); | |
} | |
} | |
@Autowired | |
@Qualifier("entrySubmitDueDate") | |
private LocalDate entrySubmitDueDate; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Provide beans for WebMvcTest.