1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.rice.kim.test.service;
18
19 import org.kuali.rice.core.api.config.property.ConfigContext;
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(new QName("KIM", svcName));
59 if (endpoints.size() > 1) {
60 fail("Found more than one RemotedServiceHolder for " + svcName);
61 }
62 Endpoint endpoint = endpoints.get(0);
63 return endpoint.getService();
64 }
65 }