1
2
3
4
5
6
7
8
9
10 package org.mule.module.ibeans.annotations;
11
12 import org.ibeans.annotation.IntegrationBean;
13 import org.junit.Test;
14
15 public class UriEncodingTestCase extends AbstractIBeansTestCase
16 {
17 @SuppressWarnings("unused")
18 @IntegrationBean
19 private TestUriIBean test;
20
21 @Test
22 public void testEncoding1() throws Exception
23 {
24 String param = "This is a value with spaces";
25 String result = test.doSomething(param);
26
27 assertEquals("http://" + TestUriIBean.DO_SOMETHING_URI + "This+is+a+value+with+spaces", result);
28 }
29
30 @Test
31 public void testEncoding2() throws Exception
32 {
33 String param = "This%20is%20a%20value%20with%20spaces";
34 String result = test.doSomething(param);
35
36 assertEquals("http://" + TestUriIBean.DO_SOMETHING_URI + "This%20is%20a%20value%20with%20spaces", result);
37 }
38 }