public void testReplaceLinkTags_oneLinkTag()
throws Throwable
{
String comment = "/** {@link ConnectException} */";
AbstractInheritableJavaEntity entity = spy( new PrivateAbstractInheritableJavaEntity() );
JavaClass clazz = mock( JavaClass.class );
when( entity.getParentClass() ).thenReturn( clazz );
when( clazz.resolveType( "ConnectException" ) ).thenReturn( "java.net.ConnectException" );
String newComment =
(String) PrivateAccessor.invoke( AbstractFixJavadocMojo.class, "replaceLinkTags", new Class[] {
String.class, AbstractInheritableJavaEntity.class }, new Object[] { comment, entity } );
assertEquals( "/** {@link java.net.ConnectException} */", newComment );