1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kim.test.service;
17
18 import org.kuali.rice.core.api.config.property.ConfigContext;
19 import org.kuali.rice.kim.api.KimApiConstants;
20 import org.kuali.rice.ksb.api.KsbApiServiceLocator;
21 import org.kuali.rice.ksb.api.bus.Endpoint;
22 import org.kuali.rice.ksb.api.bus.ServiceBus;
23
24 import javax.xml.namespace.QName;
25 import java.util.List;
26
27 import static org.junit.Assert.fail;
28
29
30
31
32
33
34
35 public class IdentityServiceRemoteTest extends IdentityServiceTest {
36
37 public void setUp() throws Exception {
38 super.setUp();
39 }
40
41 private int getConfigIntProp(String intPropKey) {
42 return Integer.parseInt(getConfigProp(intPropKey));
43 }
44
45 private String getConfigProp(String propKey) {
46 return ConfigContext.getCurrentContextConfig().getProperty(propKey);
47 }
48
49
50
51
52
53
54
55
56 protected Object getKimService(String svcName) throws Exception {
57 ServiceBus serviceBus = KsbApiServiceLocator.getServiceBus();
58 List<Endpoint> endpoints = serviceBus.getRemoteEndpoints(
59 new QName(KimApiConstants.Namespaces.KIM_NAMESPACE_2_0, svcName));
60 if (endpoints.size() > 1) {
61 fail("Found more than one RemotedServiceHolder for " + svcName);
62 }
63 Endpoint endpoint = endpoints.get(0);
64 return endpoint.getService();
65 }
66 }