1
2
3
4
5
6
7
8
9
10
11 package org.mule.test.integration.security;
12
13 import org.mule.module.client.MuleClient;
14 import org.mule.tck.AbstractServiceAndFlowTestCase;
15
16 import java.util.Arrays;
17 import java.util.Collection;
18
19 import org.junit.Test;
20 import org.junit.runners.Parameterized.Parameters;
21
22 import static org.junit.Assert.assertEquals;
23
24
25
26
27 public class OutboundHttpEndpointAuthenticationTestCase extends AbstractServiceAndFlowTestCase
28 {
29 @Parameters
30 public static Collection<Object[]> parameters()
31 {
32 return Arrays.asList(new Object[][]{
33 {ConfigVariant.SERVICE, "org/mule/test/integration/security/outbound-http-endpoint-authentication-test-service.xml"},
34 {ConfigVariant.FLOW, "org/mule/test/integration/security/outbound-http-endpoint-authentication-test-flow.xml"}
35 });
36 }
37
38 public OutboundHttpEndpointAuthenticationTestCase(ConfigVariant variant, String configResources)
39 {
40 super(variant, configResources);
41 }
42
43 @Test
44 public void testOutboundAutenticationSend() throws Exception
45 {
46 MuleClient mc = new MuleClient(muleContext);
47 assertEquals(TEST_MESSAGE, mc.send("outbound", TEST_MESSAGE, null).getPayloadAsString());
48 }
49
50 @Test
51 public void testOutboundAutenticationDispatch() throws Exception
52 {
53 MuleClient mc = new MuleClient(muleContext);
54 mc.dispatch("outbound", TEST_MESSAGE, null);
55 assertEquals(TEST_MESSAGE, mc.request("out", RECEIVE_TIMEOUT).getPayloadAsString());
56 }
57 }