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 import static org.junit.Assert.assertEquals;
16
17 public class UriEncodingTestCase extends AbstractIBeansTestCase
18 {
19 @IntegrationBean
20 private TestUriIBean test;
21
22 @Test
23 public void testEncoding1() throws Exception
24 {
25 String param = "This is a value with spaces";
26 String result = test.doSomething(param);
27
28 assertEquals("http://" + TestUriIBean.DO_SOMETHING_URI + "This+is+a+value+with+spaces", result);
29 }
30
31 @Test
32 public void testEncoding2() throws Exception
33 {
34 String param = "This%20is%20a%20value%20with%20spaces";
35 String result = test.doSomething(param);
36
37 assertEquals("http://" + TestUriIBean.DO_SOMETHING_URI + "This%20is%20a%20value%20with%20spaces", result);
38 }
39 }