Skip to content

Commit

Permalink
Helidon dependencies removed
Browse files Browse the repository at this point in the history
Signed-off-by: David Kral <david.k.kral@oracle.com>
  • Loading branch information
Verdent committed Apr 1, 2019
1 parent b816daf commit 3bfdb99
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 64 deletions.
51 changes: 24 additions & 27 deletions ext/mp-rest-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,19 @@
<version>1.3</version>
</dependency>
<dependency>
<groupId>io.helidon.microprofile.config</groupId>
<artifactId>helidon-microprofile-config-cdi</artifactId>
<version>1.0.1</version>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<artifactId>jersey-server</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
<version>1.1.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
Expand All @@ -71,6 +69,15 @@
<artifactId>weld-se-core</artifactId>
<version>3.0.3.Final</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jsonp-jaxrs</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-binding</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.test-framework</groupId>
<artifactId>jersey-test-framework-core</artifactId>
Expand All @@ -85,15 +92,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.helidon.microprofile.server</groupId>
<artifactId>helidon-microprofile-server</artifactId>
<version>1.0.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.helidon.microprofile.tests</groupId>
<artifactId>helidon-arquillian</artifactId>
<version>1.0.1-SNAPSHOT</version>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-config</artifactId>
<version>1.3.5</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -105,7 +106,6 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -117,13 +117,19 @@
<dependency>
<groupId>org.jboss.arquillian.testng</groupId>
<artifactId>arquillian-testng-container</artifactId>
<version>1.4.0.Final</version>
<version>1.4.1.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-container-test-spi</artifactId>
<version>1.4.0.Final</version>
<version>1.4.1.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-weld-embedded</artifactId>
<version>2.0.1.Final</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -132,15 +138,6 @@
<version>0.30.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jsonp-jaxrs</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-binding</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ private Object resolveValueFromField(Field field, Object instance) {
}
}

private static class Builder implements io.helidon.common.Builder<BeanClassModel> {
private static class Builder {

private final InterfaceModel interfaceModel;
private final Class<?> beanClass;
Expand Down Expand Up @@ -286,8 +286,12 @@ Builder processMatrixFields() {
return this;
}

@Override
public BeanClassModel build() {
/**
* Creates new BeanClassModel instance.
*
* @return new instance
*/
BeanClassModel build() {
return new BeanClassModel(this);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Object resolveParamValue(Object arg, Type type, Annotation[] annotations) {
return arg;
}

private static class Builder implements io.helidon.common.Builder<InterfaceModel> {
private static class Builder {

private final Class<?> restClientClass;

Expand Down Expand Up @@ -321,8 +321,12 @@ Builder clientHeadersFactory(RegisterClientHeaders registerClientHeaders) {
return this;
}

@Override
public InterfaceModel build() {
/**
* Creates new InterfaceModel instance.
*
* @return new instance
*/
InterfaceModel build() {
validateHeaderDuplicityNames();
return new InterfaceModel(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
Expand Down Expand Up @@ -66,8 +67,6 @@
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;

import io.helidon.common.CollectionsHelper;

import org.eclipse.microprofile.rest.client.RestClientDefinitionException;
import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam;
import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper;
Expand Down Expand Up @@ -407,7 +406,7 @@ private static List<String> createList(Object value) {
return Arrays.asList(array);
}
String s = (String) value;
return CollectionsHelper.listOf(s);
return Collections.singletonList(s);
}

/**
Expand Down Expand Up @@ -468,7 +467,7 @@ private static List<ParamModel> parameterModels(InterfaceModel classModel, Metho
return parameterModels;
}

private static class Builder implements io.helidon.common.Builder<MethodModel> {
private static class Builder {

private final InterfaceModel interfaceModel;
private final Method method;
Expand Down Expand Up @@ -609,11 +608,14 @@ Builder clientHeaders(ClientHeaderParam[] clientHeaderParams) {
return this;
}

@Override
public MethodModel build() {
/**
* Creates new MethodModel instance.
*
* @return new instance
*/
MethodModel build() {
validateParameters();
validateHeaderDuplicityNames();
//TODO uklidit
Optional<ParamModel> entity = parameterModels.stream()
.filter(ParamModel::isEntity)
.findFirst();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ boolean isEntity() {
*/
abstract boolean handles(Class<Annotation> annotation);

protected static class Builder implements io.helidon.common.Builder<ParamModel> {
protected static class Builder {

private InterfaceModel interfaceModel;
private Type type;
Expand Down Expand Up @@ -263,8 +263,12 @@ String formParamName() {
return matrixParamName;
}

@Override
public ParamModel build() {
/**
* Creates new ParamModel instance.
*
* @return new instance
*/
ParamModel build() {
if (pathParamName != null) {
return new PathParamModel(this);
} else if (headerParamName != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper;
import org.eclipse.microprofile.rest.client.spi.RestClientListener;
import org.glassfish.jersey.client.JerseyClientBuilder;
import org.glassfish.jersey.server.model.Resource;

/**
* Rest client builder implementation. Creates proxy instance of requested interface.
Expand Down Expand Up @@ -158,6 +159,9 @@ public <T> T build(Class<T> interfaceClass) throws IllegalStateException, RestCl
responseExceptionMappers,
paramConverterProviders,
asyncInterceptorFactories);

Resource resource = Resource.from(interfaceClass);

//AsyncInterceptors initialization
List<AsyncInvocationInterceptor> asyncInterceptors = asyncInterceptorFactories.stream()
.map(AsyncInvocationInterceptorFactory::newInterceptor)
Expand Down Expand Up @@ -249,7 +253,7 @@ public RestClientBuilder register(Class<?> aClass, Map<Class<?>, Integer> map) {
if (isSupportedCustomProvider(aClass)) {
register(ReflectionUtil.createInstance(aClass), map);
} else {
jerseyClientBuilder.register(aClass, new HashMap<>(map));
jerseyClientBuilder.register(aClass, map);
}
return this;
}
Expand Down Expand Up @@ -294,7 +298,7 @@ public RestClientBuilder register(Object o, Map<Class<?>, Integer> map) {
registerCustomProvider(o, map.get(ParamConverterProvider.class));
}
}
jerseyClientBuilder.register(o, new HashMap<>(map));
jerseyClientBuilder.register(o, map);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static RestClientModel from(Class<?> restClientClass,
paramConverterProviders,
interceptorFactories);
return new Builder()
.classModel(interfaceModel)
.interfaceModel(interfaceModel)
.methodModels(parseMethodModels(interfaceModel))
.build();
}
Expand Down Expand Up @@ -94,7 +94,7 @@ private static Map<Method, MethodModel> parseMethodModels(InterfaceModel classMo
return methodMap;
}

private static class Builder implements io.helidon.common.Builder<RestClientModel> {
private static class Builder {

private InterfaceModel classModel;
private Map<Method, MethodModel> methodModels;
Expand All @@ -108,7 +108,7 @@ private Builder() {
* @param classModel {@link InterfaceModel} instance
* @return Updated Builder instance
*/
Builder classModel(InterfaceModel classModel) {
Builder interfaceModel(InterfaceModel classModel) {
this.classModel = classModel;
return this;
}
Expand All @@ -124,7 +124,11 @@ Builder methodModels(Map<Method, MethodModel> methodModels) {
return this;
}

@Override
/**
* Creates new RestClientModel instance.
*
* @return new instance
*/
public RestClientModel build() {
return new RestClientModel(this);
}
Expand Down
Loading

0 comments on commit 3bfdb99

Please sign in to comment.