Java Code Examples for org.springframework.web.servlet.handler.HandlerMethodMappingNamingStrategy

The following examples show how to use org.springframework.web.servlet.handler.HandlerMethodMappingNamingStrategy. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Test
public void getNameExplicit() {

	Method method = ClassUtils.getMethod(TestController.class, "handle");
	HandlerMethod handlerMethod = new HandlerMethod(new TestController(), method);

	RequestMappingInfo rmi = new RequestMappingInfo("foo", null, null, null, null, null, null, null);

	HandlerMethodMappingNamingStrategy<RequestMappingInfo> strategy = new RequestMappingInfoHandlerMethodMappingNamingStrategy();

	assertEquals("foo", strategy.getName(handlerMethod, rmi));
}
 
Example 2
@Test
public void getNameConvention() {

	Method method = ClassUtils.getMethod(TestController.class, "handle");
	HandlerMethod handlerMethod = new HandlerMethod(new TestController(), method);

	RequestMappingInfo rmi = new RequestMappingInfo(null, null, null, null, null, null, null, null);

	HandlerMethodMappingNamingStrategy<RequestMappingInfo> strategy = new RequestMappingInfoHandlerMethodMappingNamingStrategy();

	assertEquals("TC#handle", strategy.getName(handlerMethod, rmi));
}
 
Example 3
@Test
public void getNameExplicit() {

	Method method = ClassUtils.getMethod(TestController.class, "handle");
	HandlerMethod handlerMethod = new HandlerMethod(new TestController(), method);

	RequestMappingInfo rmi = new RequestMappingInfo("foo", null, null, null, null, null, null, null);

	HandlerMethodMappingNamingStrategy<RequestMappingInfo> strategy = new RequestMappingInfoHandlerMethodMappingNamingStrategy();

	assertEquals("foo", strategy.getName(handlerMethod, rmi));
}
 
Example 4
@Test
public void getNameConvention() {

	Method method = ClassUtils.getMethod(TestController.class, "handle");
	HandlerMethod handlerMethod = new HandlerMethod(new TestController(), method);

	RequestMappingInfo rmi = new RequestMappingInfo(null, null, null, null, null, null, null, null);

	HandlerMethodMappingNamingStrategy<RequestMappingInfo> strategy = new RequestMappingInfoHandlerMethodMappingNamingStrategy();

	assertEquals("TC#handle", strategy.getName(handlerMethod, rmi));
}
 
Example 5
@Test
public void getNameExplicit() {

	Method method = ClassUtils.getMethod(TestController.class, "handle");
	HandlerMethod handlerMethod = new HandlerMethod(new TestController(), method);

	RequestMappingInfo rmi = new RequestMappingInfo("foo", null, null, null, null, null, null, null);

	HandlerMethodMappingNamingStrategy strategy = new RequestMappingInfoHandlerMethodMappingNamingStrategy();

	assertEquals("foo", strategy.getName(handlerMethod, rmi));
}
 
Example 6
@Test
public void getNameConvention() {

	Method method = ClassUtils.getMethod(TestController.class, "handle");
	HandlerMethod handlerMethod = new HandlerMethod(new TestController(), method);

	RequestMappingInfo rmi = new RequestMappingInfo(null, null, null, null, null, null, null, null);

	HandlerMethodMappingNamingStrategy strategy = new RequestMappingInfoHandlerMethodMappingNamingStrategy();

	assertEquals("TC#handle", strategy.getName(handlerMethod, rmi));
}