Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
0-wook committed Feb 19, 2024
1 parent a8b090d commit 86617e5
Showing 1 changed file with 14 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,23 @@
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@WebMvcTest(
controllers = HelloController.class,
excludeFilters = {
@ComponentScan.Filter(
type = FilterType.ASSIGNABLE_TYPE,
classes = SecurityConfig.class
)
}
)
@WebMvcTest(controllers = HelloController.class, excludeFilters = {
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = SecurityConfig.class)
})
@AutoConfigureMockMvc
class HelloControllerTest {

@Autowired
private MockMvc mockMvc;
@Autowired
private MockMvc mockMvc;

@Test
@WithMockUser
void hello() throws Exception {
ResultActions action = mockMvc.perform(
get("/hello")
);
@Test
@WithMockUser
void hello() throws Exception {
ResultActions action = mockMvc.perform(
get("/hello"));

action
.andExpect(status().isOk())
.andExpect(content().string("Hello, World!"));
}
action
.andExpect(status().isOk())
.andExpect(content().string("Hello, World!"));
}
}

0 comments on commit 86617e5

Please sign in to comment.