BAEL-97 - simplifying code
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package com.baeldung.handlermapping;
|
||||
package com.baeldung.handlermappings;
|
||||
|
||||
import com.baeldung.spring.web.config.BeanNameUrlHandlerMappingConfig;
|
||||
import org.junit.Before;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.baeldung.handlermapping;
|
||||
package com.baeldung.handlermappings;
|
||||
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
|
||||
@@ -1,10 +1,7 @@
|
||||
package com.baeldung.handlermapping;
|
||||
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view;
|
||||
package com.baeldung.handlermappings;
|
||||
|
||||
import com.baeldung.spring.web.config.HandlerMappingCustomPrioritiesConfig;
|
||||
import com.baeldung.spring.web.config.HandlerMappingPrioritiesConfig;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -17,7 +14,10 @@ import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
|
||||
import com.baeldung.spring.web.config.HandlerMappingPrioritiesConfig;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@WebAppConfiguration
|
||||
@@ -36,6 +36,6 @@ public class HandlerMappingPriorityConfigTest {
|
||||
|
||||
@Test
|
||||
public void whenConfiguringPriorities_thenMappedOK() throws Exception {
|
||||
mockMvc.perform(get("/welcome")).andExpect(status().isOk()).andExpect(view().name("test")).andDo(print());
|
||||
mockMvc.perform(get("/welcome")).andExpect(status().isOk()).andExpect(view().name("bean-name-handler-mapping")).andDo(print());
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.baeldung.handlermapping;
|
||||
package com.baeldung.handlermappings;
|
||||
|
||||
import com.baeldung.spring.web.config.SimpleUrlHandlerMappingConfig;
|
||||
import org.junit.Before;
|
||||
Reference in New Issue
Block a user