View Javadoc

1   package com.atlassian.plugins.rest.common;
2   
3   import org.junit.Test;
4   
5   import com.sun.jersey.api.uri.UriTemplateParser;
6   
7   import static org.junit.Assert.assertEquals;
8   
9   public class UriTemplateParserTest {
10      /**
11       * Make sure that whatever version of Jersey we're using, it at least has the fix for
12       * https://java.net/jira/browse/JERSEY-1198 (atlassian issue: https://ecosystem.atlassian.net/browse/REST-247 )
13       */
14      @Test
15      public void canHaveRegularExpressionCharactersInTemplate() {
16          UriTemplateParser parser = new UriTemplateParser(".^&!?-:<([$=)],>*+|");
17  
18          assertEquals("\\.\\^\\&\\!\\?\\-\\:\\<\\(\\[\\$\\=\\)\\]\\,\\>\\*\\+\\|", parser.getPattern().pattern());
19      }
20  }