TransactionTokenInfoStore { TransactionTokenInfo createTransactionTokenInfo( final HandlerMethod handlerMethod) { TransactionTokenCheck methodAnnotation = handlerMethod .getMethodAnnotation(TransactionTokenCheck.class); TransactionTokenCheck classAnnotation = AnnotationUtils.findAnnotation( handlerMethod.getBeanType(), TransactionTokenCheck.class); if (methodAnnotation == null) { return new TransactionTokenInfo(null, TransactionTokenType.NONE); } String tokenName = createTokenName(classAnnotation, methodAnnotation); return new TransactionTokenInfo(tokenName, methodAnnotation.type()); } TransactionTokenInfoStore(); TransactionTokenInfo getTransactionTokenInfo(
            final HandlerMethod handlerMethod);  }
@Test public void testCreateTransactionTokenInfo01() throws Exception { HandlerMethod handlerMethod = new HandlerMethod(new TransactionTokenSampleController(), TransactionTokenSampleController.class .getDeclaredMethod("fourth", SampleForm.class, Model.class)); TransactionTokenInfo tokenInfo = store.createTransactionTokenInfo( handlerMethod); assertThat(tokenInfo, is(notNullValue())); }
@Test public void testCreateTransactionTokenInfo02() throws Exception { HandlerMethod handlerMethod = new HandlerMethod(new TransactionTokenSampleController(), TransactionTokenSampleController.class .getDeclaredMethod("first", SampleForm.class, Model.class)); TransactionTokenInfo tokenInfo = store.createTransactionTokenInfo( handlerMethod); assertThat(tokenInfo, is(notNullValue())); }
@Test public void testNamespaceCreateTransactionTokenInfo() throws Exception { HandlerMethod handlerMethod = new HandlerMethod(new TransactionTokenSampleNamespaceController(), TransactionTokenSampleNamespaceController.class .getDeclaredMethod("first")); TransactionTokenInfo tokenInfo = store.createTransactionTokenInfo( handlerMethod); assertThat(tokenInfo.getTokenName(), containsString( "testTokenAttrByNameSpace")); }