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.kim.api.KimApiConstants;
21 import org.kuali.rice.ksb.api.KsbApiServiceLocator;
22 import org.kuali.rice.ksb.api.bus.Endpoint;
23 import org.kuali.rice.ksb.api.bus.ServiceBus;
24
25 import javax.xml.namespace.QName;
26 import java.util.List;
27
28 import static org.junit.Assert.fail;
29
30
31
32
33
34
35
36 public class GroupServiceRemoteTest extends GroupServiceTest {
37
38 public void setUp() throws Exception {
39 super.setUp();
40 }
41
42
43
44
45
46
47 private int getConfigIntProp(String intPropKey) {
48 return Integer.parseInt(getConfigProp(intPropKey));
49 }
50
51 private String getConfigProp(String propKey) {
52 return ConfigContext.getCurrentContextConfig().getProperty(propKey);
53 }
54
55
56
57
58
59
60
61
62 protected Object getKimService(String svcName) throws Exception {
63 ServiceBus serviceBus = KsbApiServiceLocator.getServiceBus();
64 List<Endpoint> endpoints = serviceBus.getRemoteEndpoints(new QName(KimApiConstants.Namespaces.KIM_NAMESPACE_2_0, svcName));
65 if (endpoints.size() > 1) {
66 fail("Found more than one RemotedServiceHolder for " + svcName);
67 }
68 Endpoint endpoint = endpoints.get(0);
69 return endpoint.getService();
70 }
71 }