Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
Keep compatibility with spring boot1.
Browse files Browse the repository at this point in the history
  • Loading branch information
uich committed Dec 10, 2018
1 parent 3616905 commit d42255a
Show file tree
Hide file tree
Showing 5 changed files with 154 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .gitignore
@@ -1,4 +1,4 @@
target/
**/target/
!.mvn/wrapper/maven-wrapper.jar

### STS ###
Expand All @@ -21,4 +21,4 @@ build/
nbbuild/
dist/
nbdist/
.nb-gradle/
.nb-gradle/
Expand Up @@ -130,14 +130,14 @@ private List<CEKHandlerMethod> extractHandlerMethods(Object requestHandler) {
+ "method:" + method + "]");
}

MethodParameter returnType = MethodParameter.forExecutable(method, -1);
MethodParameter returnType = new MethodParameter(method, -1);
if (!CEKResponse.class.isAssignableFrom(returnType.getParameterType())) {
throw new UnsupportedHandlerArgumentException(returnType, "Unsupported type method returns.");
}

List<MethodParameter> methodParams =
IntStream.range(0, method.getParameterCount())
.mapToObj(paramIndex -> MethodParameter.forExecutable(method, paramIndex))
.mapToObj(paramIndex -> new MethodParameter(method, paramIndex))
.peek(methodParam -> methodParam.initParameterNameDiscovery(
PARAMETER_NAME_DISCOVERER))
.collect(toList());
Expand Down
Expand Up @@ -662,9 +662,9 @@ class MockSet {
.method(dummyMethod)
.name("Clova.Event")
.methodParams(Arrays.asList(
MethodParameter.forExecutable(dummyMethod, 0),
MethodParameter.forExecutable(dummyMethod, 1),
MethodParameter.forExecutable(dummyMethod, 2)
new MethodParameter(dummyMethod, 0),
new MethodParameter(dummyMethod, 1),
new MethodParameter(dummyMethod, 2)
))
.build());

Expand Down
146 changes: 146 additions & 0 deletions compatibility/test-spring-boot1/pom.xml
@@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2018 LINE Corporation
~
~ LINE Corporation licenses this file to you under the Apache License,
~ version 2.0 (the "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at:
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
~ License for the specific language governing permissions and limitations
~ under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.18.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.linecorp.clova</groupId>
<artifactId>test-spring-boot1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>test-spring-boot1</name>
<description>Tests for Spring Boot1</description>

<properties>
<java.version>1.8</java.version>
<clova-cek-sdk-java.version>1.1.0-SNAPSHOT</clova-cek-sdk-java.version>
<mockito.version>2.15.0</mockito.version>
<hibernate-validator.version>6.0.13.Final</hibernate-validator.version>
<assertj.version>3.9.0</assertj.version>
<commons-text.version>1.3</commons-text.version>
<validation-api.version>2.0.1.Final</validation-api.version>
<guava.version>18.0</guava.version>
</properties>

<dependencies>
<dependency>
<groupId>com.linecorp.clova</groupId>
<artifactId>clova-extension-boot-web</artifactId>
<version>${clova-cek-sdk-java.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.8.11</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
<version>2.8.11</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>com.linecorp.clova</groupId>
<artifactId>clova-extension-test</artifactId>
<version>${clova-cek-sdk-java.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>${commons-text.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>

<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>${validation-api.version}</version>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>add-test-source</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>../../clova-extension-boot-web/src/test/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-test-resource</id>
<phase>generate-test-resources</phase>
<goals>
<goal>add-test-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>../../clova-extension-boot-web/src/test/resources</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>


</project>
1 change: 1 addition & 0 deletions pom.xml
Expand Up @@ -73,6 +73,7 @@
<module>clova-extension-boot-web</module>
<module>clova-extension-test</module>
<module>clova-extension-model</module>
<module>compatibility/test-spring-boot1</module>
</modules>

<distributionManagement>
Expand Down

0 comments on commit d42255a

Please sign in to comment.