TransactionTokenInfoStore { String createTokenName(final TransactionTokenCheck classAnnotation, final TransactionTokenCheck methodAnnotation) { String methodTokenName = methodAnnotation.value(); String classTokenName = (classAnnotation == null) ? "" : classAnnotation.value(); StringBuilder tokenNameStringBuilder = new StringBuilder(); if (classTokenName != null && !classTokenName.isEmpty()) { tokenNameStringBuilder.append(classTokenName); } if (methodTokenName != null && !methodTokenName.isEmpty()) { if (tokenNameStringBuilder.length() != 0) { tokenNameStringBuilder.append("/"); } tokenNameStringBuilder.append(methodTokenName); } if (tokenNameStringBuilder.length() == 0) { tokenNameStringBuilder.append(globalTokenName); } return tokenNameStringBuilder.toString(); } TransactionTokenInfoStore(); TransactionTokenInfo getTransactionTokenInfo(
            final HandlerMethod handlerMethod);  }
@Test public void testCreateTokenInfoName01() throws Exception { TransactionTokenCheck methodAnnotation = mock( TransactionTokenCheck.class); TransactionTokenCheck classAnnotation = mock( TransactionTokenCheck.class); when(methodAnnotation.value()).thenReturn("test"); when(classAnnotation.value()).thenReturn("test"); assertThat(store.createTokenName(classAnnotation, methodAnnotation), is( notNullValue())); }
@Test public void testCreateTokenInfoName02() throws Exception { TransactionTokenCheck methodAnnotation = mock( TransactionTokenCheck.class); TransactionTokenCheck classAnnotation = null; when(methodAnnotation.value()).thenReturn("test"); assertThat(store.createTokenName(classAnnotation, methodAnnotation), is( notNullValue())); }
@Test public void testCreateTokenInfoName03() throws Exception { TransactionTokenCheck methodAnnotation = mock( TransactionTokenCheck.class); TransactionTokenCheck classAnnotation = null; when(methodAnnotation.value()).thenReturn(""); assertThat(store.createTokenName(classAnnotation, methodAnnotation), is( notNullValue())); }
@Test public void testCreateTokenInfoName04() throws Exception { TransactionTokenCheck methodAnnotation = mock( TransactionTokenCheck.class); TransactionTokenCheck classAnnotation = null; when(methodAnnotation.value()).thenReturn(null); assertThat(store.createTokenName(classAnnotation, methodAnnotation), is( notNullValue())); }
@Test public void testCreateTokenInfoName05() throws Exception { TransactionTokenCheck methodAnnotation = mock( TransactionTokenCheck.class); TransactionTokenCheck classAnnotation = mock( TransactionTokenCheck.class); when(methodAnnotation.value()).thenReturn("test"); when(classAnnotation.value()).thenReturn(""); assertThat(store.createTokenName(classAnnotation, methodAnnotation), is( notNullValue())); }
@Test public void testCreateTokenInfoName06() throws Exception { TransactionTokenCheck methodAnnotation = mock( TransactionTokenCheck.class); TransactionTokenCheck classAnnotation = mock( TransactionTokenCheck.class); when(methodAnnotation.value()).thenReturn("test"); when(classAnnotation.value()).thenReturn(null); assertThat(store.createTokenName(classAnnotation, methodAnnotation), is( notNullValue())); }