Compare commits
27
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76bd458481 | ||
|
|
c0022d9f90 | ||
|
|
d7429967c4 | ||
|
|
36d7de4c42 | ||
|
|
b58f36169b | ||
|
|
449c352aa5 | ||
|
|
0ed36d0faf | ||
|
|
7f89bdae81 | ||
|
|
c035e9bec2 | ||
|
|
24608d99c8 | ||
|
|
19d879308d | ||
|
|
1bb80dd0e3 | ||
|
|
eacbcaae30 | ||
|
|
5a509eeb82 | ||
|
|
cf7f30328d | ||
|
|
af43f12d72 | ||
|
|
49a3255e4d | ||
|
|
d8a365eb37 | ||
|
|
d8aa8253c4 | ||
|
|
5ab46e19ac | ||
|
|
fd129b992c | ||
|
|
c67a869fee | ||
|
|
06de852f2a | ||
|
|
733310cf3e | ||
|
|
1618d9956d | ||
|
|
c48c9531bf | ||
|
|
ade7e9b5a0 |
@@ -5,10 +5,10 @@
|
|||||||
|
|
||||||
<groupId>com.inteligr8.alfresco</groupId>
|
<groupId>com.inteligr8.alfresco</groupId>
|
||||||
<artifactId>aps-public-rest-client</artifactId>
|
<artifactId>aps-public-rest-client</artifactId>
|
||||||
<version>3.0.3-jersey</version>
|
<version>3.0.3-cxf</version>
|
||||||
|
|
||||||
<name>Alfresco Process Services ReST API Client for Java</name>
|
<name>Alfresco Process Services ReST API Client for Java</name>
|
||||||
<description>An APS Client library for building Jersey-based REST API clients</description>
|
<description>An APS Client library for building CXF-based REST API clients</description>
|
||||||
<url>https://git.inteligr8.com/inteligr8/aps-public-rest-client</url>
|
<url>https://git.inteligr8.com/inteligr8/aps-public-rest-client</url>
|
||||||
|
|
||||||
<licenses>
|
<licenses>
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.inteligr8</groupId>
|
<groupId>com.inteligr8</groupId>
|
||||||
<artifactId>common-rest-client</artifactId>
|
<artifactId>common-rest-client</artifactId>
|
||||||
<version>3.0.4-jersey</version>
|
<version>3.0.4-cxf</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.inteligr8.alfresco</groupId>
|
<groupId>com.inteligr8.alfresco</groupId>
|
||||||
@@ -112,7 +112,7 @@
|
|||||||
<goals><goal>add-source</goal></goals>
|
<goals><goal>add-source</goal></goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<sources>
|
<sources>
|
||||||
<source>src/main/jersey</source>
|
<source>src/main/cxf</source>
|
||||||
</sources>
|
</sources>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
@@ -121,7 +121,7 @@
|
|||||||
<goals><goal>add-test-source</goal></goals>
|
<goals><goal>add-test-source</goal></goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<sources>
|
<sources>
|
||||||
<source>src/test/jersey</source>
|
<source>src/test/cxf</source>
|
||||||
</sources>
|
</sources>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
|||||||
+10
-10
@@ -18,11 +18,11 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.context.annotation.ComponentScan;
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
import com.inteligr8.rs.ClientJerseyConfiguration;
|
import com.inteligr8.rs.ClientCxfConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class provides a POJO & Spring-based implementation of the
|
* This class provides a POJO & Spring-based implementation of the
|
||||||
* ClientJerseyConfiguration interface. You can use it outside of the Spring
|
* ClientCxfConfiguration interface. You can use it outside of the Spring
|
||||||
* context, but you will need the spring-context and spring-beans libraries in
|
* context, but you will need the spring-context and spring-beans libraries in
|
||||||
* your non-Spring application.
|
* your non-Spring application.
|
||||||
*
|
*
|
||||||
@@ -30,17 +30,17 @@ import com.inteligr8.rs.ClientJerseyConfiguration;
|
|||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@ComponentScan
|
@ComponentScan
|
||||||
public class ApsClientJerseyConfiguration extends ApsClientConfiguration implements ClientJerseyConfiguration {
|
public class ApsClientCxfConfiguration extends ApsClientConfiguration implements ClientCxfConfiguration {
|
||||||
|
|
||||||
|
@Value("${process.service.cxf.defaultBusEnabled:true}")
|
||||||
|
private boolean defaultBusEnabled;
|
||||||
|
|
||||||
@Value("${process.service.jersey.putBodyRequired:true}")
|
public boolean isDefaultBusEnabled() {
|
||||||
private boolean putBodyRequired;
|
return this.defaultBusEnabled;
|
||||||
|
|
||||||
public boolean isPutBodyRequired() {
|
|
||||||
return this.putBodyRequired;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPutBodyRequired(boolean putBodyRequired) {
|
public void setDefaultBusEnabled(boolean defaultBusEnabled) {
|
||||||
this.putBodyRequired = putBodyRequired;
|
this.defaultBusEnabled = defaultBusEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+9
-9
@@ -18,25 +18,25 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import com.inteligr8.rs.ClientJerseyImpl;
|
import com.inteligr8.rs.ClientCxfImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class provides a POJO & Spring-based implementation of the Jersey
|
* This class provides a POJO & Spring-based implementation of the Apache
|
||||||
* client configured for APS. You can use it outside of the Spring context,
|
* CXF client. You can use it outside of the Spring context, but you will need
|
||||||
* but you will need the spring-context and spring-beans libraries in your
|
* the spring-context and spring-beans libraries in your non-Spring
|
||||||
* non-Spring application.
|
* application.
|
||||||
*
|
*
|
||||||
* @author brian@inteligr8.com
|
* @author brian@inteligr8.com
|
||||||
*/
|
*/
|
||||||
@Component("aps.client.jersey")
|
@Component("aps.client.cxf")
|
||||||
@Lazy
|
@Lazy
|
||||||
public class ApsClientJerseyImpl extends ClientJerseyImpl {
|
public class ApsClientCxfImpl extends ClientCxfImpl {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This constructor is for Spring and POJO use
|
* This constructor is for Spring or POJO use
|
||||||
*/
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
public ApsClientJerseyImpl(ApsClientJerseyConfiguration config) {
|
public ApsClientCxfImpl(ApsClientCxfConfiguration config) {
|
||||||
super(config);
|
super(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
+5
-5
@@ -19,20 +19,20 @@ import org.springframework.context.annotation.Lazy;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class provides the Jersey client to the JAX-RS API for the Activiti &
|
* This class provides the Apache CXF client to the JAX-RS API for the Activiti
|
||||||
* APS public ReST API and some non-public APS ReST API.
|
* & APS public ReST APIs and some non-public APS ReST APIs.
|
||||||
*
|
*
|
||||||
* @author brian@inteligr8.com
|
* @author brian@inteligr8.com
|
||||||
*/
|
*/
|
||||||
@Component("aps.protected-api.jersey")
|
@Component("aps.protected-api.cxf")
|
||||||
@Lazy
|
@Lazy
|
||||||
public class ApsProtectedRestApiJerseyImpl extends ApsProtectedRestApiImpl implements ApsProtectedRestJerseyApi {
|
public class ApsProtectedRestApiCxfImpl extends ApsProtectedRestApiImpl implements ApsProtectedRestCxfApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This constructor is for Spring or POJO use
|
* This constructor is for Spring or POJO use
|
||||||
*/
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
public ApsProtectedRestApiJerseyImpl(ApsClientJerseyImpl client) {
|
public ApsProtectedRestApiCxfImpl(ApsClientCxfImpl client) {
|
||||||
super(client);
|
super(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
+5
-5
@@ -19,20 +19,20 @@ import org.springframework.context.annotation.Lazy;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class provides the Jersey client to the JAX-RS API for the APS Public
|
* This class provides the Apache CXF client to the JAX-RS API for the APS
|
||||||
* ReST API.
|
* Public ReST API.
|
||||||
*
|
*
|
||||||
* @author brian@inteligr8.com
|
* @author brian@inteligr8.com
|
||||||
*/
|
*/
|
||||||
@Component("aps.api.jersey")
|
@Component("aps.api.cxf")
|
||||||
@Lazy
|
@Lazy
|
||||||
public class ApsPublicRestApiJerseyImpl extends ApsPublicRestApiImpl implements ApsPublicRestJerseyApi {
|
public class ApsPublicRestApiCxfImpl extends ApsPublicRestApiImpl implements ApsPublicRestCxfApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This constructor is for Spring or POJO use
|
* This constructor is for Spring or POJO use
|
||||||
*/
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
public ApsPublicRestApiJerseyImpl(ApsClientJerseyImpl client) {
|
public ApsPublicRestApiCxfImpl(ApsClientCxfImpl client) {
|
||||||
super(client);
|
super(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
org.apache.cxf.jaxrs.client.spec.ClientBuilderImpl
|
||||||
+5
-4
@@ -18,21 +18,22 @@ import org.junit.jupiter.api.BeforeAll;
|
|||||||
|
|
||||||
import com.inteligr8.rs.ClientConfiguration;
|
import com.inteligr8.rs.ClientConfiguration;
|
||||||
|
|
||||||
public class ConnectionJerseyClientPojoIT extends ConnectionClientIT {
|
public class ConnectionCxfClientPojoIT extends ConnectionClientIT {
|
||||||
|
|
||||||
private static ApsPublicRestApiImpl api;
|
private static ApsPublicRestApiImpl api;
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void initClient() {
|
public static void initClient() {
|
||||||
ApsClientJerseyConfiguration config = new ApsClientJerseyConfiguration();
|
ApsClientCxfConfiguration config = new ApsClientCxfConfiguration();
|
||||||
config.setBaseUrl("http://localhost:8080/activiti-app");
|
config.setBaseUrl("http://localhost:8080/activiti-app");
|
||||||
config.setBasicAuthUsername("admin");
|
config.setBasicAuthUsername("admin");
|
||||||
config.setBasicAuthPassword("admin");
|
config.setBasicAuthPassword("admin");
|
||||||
|
|
||||||
api = new ApsPublicRestApiJerseyImpl(
|
api = new ApsPublicRestApiCxfImpl(
|
||||||
new ApsClientJerseyImpl(config));
|
new ApsClientCxfImpl(config));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ApsPublicRestApiImpl getApi() {
|
public ApsPublicRestApiImpl getApi() {
|
||||||
return api;
|
return api;
|
||||||
}
|
}
|
||||||
+5
-4
@@ -21,14 +21,15 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
|||||||
|
|
||||||
import com.inteligr8.rs.ClientConfiguration;
|
import com.inteligr8.rs.ClientConfiguration;
|
||||||
|
|
||||||
@TestPropertySource(locations = {"/local.properties"})
|
@TestPropertySource(locations = {"/local-oauth.properties"})
|
||||||
@SpringJUnitConfig(classes = {ApsClientJerseyConfiguration.class, ApsPublicRestApiJerseyImpl.class, ApsClientJerseyImpl.class})
|
@SpringJUnitConfig(classes = {ApsClientCxfConfiguration.class, ApsPublicRestApiCxfImpl.class, ApsClientCxfImpl.class})
|
||||||
public class ConnectionJerseyClientSpringIT extends ConnectionClientIT {
|
public class ConnectionCxfClientSpringIT extends ConnectionClientIT {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@Qualifier("aps.api.jersey")
|
@Qualifier("aps.api.cxf")
|
||||||
private ApsPublicRestApiImpl api;
|
private ApsPublicRestApiImpl api;
|
||||||
|
|
||||||
|
@Override
|
||||||
public ApsPublicRestApiImpl getApi() {
|
public ApsPublicRestApiImpl getApi() {
|
||||||
return this.api;
|
return this.api;
|
||||||
}
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
org.glassfish.jersey.client.JerseyClientBuilder
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
/*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or (at your
|
|
||||||
* option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along
|
|
||||||
* with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package com.inteligr8.alfresco.activiti;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Assertions;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.junit.jupiter.api.condition.EnabledIf;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
|
||||||
import org.springframework.test.context.TestPropertySource;
|
|
||||||
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
|
||||||
|
|
||||||
import com.inteligr8.alfresco.activiti.model.Tenant;
|
|
||||||
import com.inteligr8.rs.ClientConfiguration;
|
|
||||||
|
|
||||||
@TestPropertySource(locations = {"/local.properties"})
|
|
||||||
@SpringJUnitConfig(classes = {ApsClientJerseyConfiguration.class, ApsPublicRestApiJerseyImpl.class, ApsClientJerseyImpl.class})
|
|
||||||
public class ArrayResponseUnitTest extends ConditionalIT {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
@Qualifier("aps.api.jersey")
|
|
||||||
private ApsPublicRestApiImpl api;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ClientConfiguration getConfiguration() {
|
|
||||||
return this.api.getClient().getConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@EnabledIf("hostExists")
|
|
||||||
public void testTenants() {
|
|
||||||
List<Tenant> objs = this.api.getAdminApi().getTenants();
|
|
||||||
|
|
||||||
Assertions.assertNotNull(objs);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
/*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or (at your
|
|
||||||
* option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
||||||
* more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along
|
|
||||||
* with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package com.inteligr8.alfresco.activiti;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Assertions;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.junit.jupiter.api.condition.EnabledIf;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
|
||||||
import org.springframework.test.context.TestPropertySource;
|
|
||||||
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
|
||||||
|
|
||||||
import com.inteligr8.alfresco.activiti.model.GroupLight;
|
|
||||||
import com.inteligr8.activiti.model.ResultList;
|
|
||||||
import com.inteligr8.alfresco.activiti.model.UserLight;
|
|
||||||
import com.inteligr8.rs.ClientConfiguration;
|
|
||||||
|
|
||||||
@TestPropertySource(locations = {"/local.properties"})
|
|
||||||
@SpringJUnitConfig(classes = {ApsClientJerseyConfiguration.class, ApsPublicRestApiJerseyImpl.class, ApsClientJerseyImpl.class})
|
|
||||||
public class ResultListResponseUnitTest extends ConditionalIT {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
@Qualifier("aps.api.jersey")
|
|
||||||
private ApsPublicRestApiImpl api;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ClientConfiguration getConfiguration() {
|
|
||||||
return this.api.getClient().getConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@EnabledIf("hostExists")
|
|
||||||
public void testGroupMembers() {
|
|
||||||
List<GroupLight> groups = this.api.getAdminApi().getGroups(1L, false, false);
|
|
||||||
Assertions.assertFalse(groups.isEmpty());
|
|
||||||
|
|
||||||
for (GroupLight group : groups) {
|
|
||||||
ResultList<UserLight> users = this.api.getAdminApi().getMembers(group.getId(), null, null, null);
|
|
||||||
Assertions.assertNotNull(users);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user