Created
April 17, 2019 23:30
-
-
Save singun/6607e0004e1c271a6e7047cb40fbb1b9 to your computer and use it in GitHub Desktop.
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
@ExtendWith(MockitoExtension.class) | |
class OwnerControllerTest { | |
@InjectMocks | |
OwnerController ownerController; | |
MockMvc mockMvc; | |
@BeforeEach | |
void setUp() { | |
mockMvc = MockMvcBuilders.standaloneSetup(ownerController).build(); | |
} | |
@Test | |
void initCreationForm() throws Exception { | |
mockMvc.perform(get("/owners/new")) | |
.andExpect(status().isOk()) | |
.andExpect(model().attributeExists("owner")) | |
.andExpect(view().name("owners/createOrUpdateOwnerForm")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment