Skip to content

Commit f60baf4

Browse files
authored
Merge pull request #45 from allanim/master
Update Build & Serializable object
2 parents e82ef91 + 11d2191 commit f60baf4

39 files changed

+111
-47
lines changed

.codeclimate.yml

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ plugins:
3333
enabled: true
3434
config:
3535
sonar.java.source: 8
36+
checks:
37+
squid:S1948:
38+
enabled: false
3639
exclude_patterns:
3740
- 'config/'
3841
- '**/dist/'

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
[![Javadocs](http://javadoc.io/badge/com.vogle.sbpayment/sbpayment-client.svg)](http://javadoc.io/doc/com.vogle.sbpayment/sbpayment-client)
66
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
77
[![Gitter](https://badges.gitter.im/vogle/sbpayment.svg)](https://gitter.im/vogle/sbpayment?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
8-
[![Gradle Scan](https://img.shields.io/badge/Gradle-Scan-blue.svg)](https://vogle.page.link/scan)
98

109
[![Build Status](https://travis-ci.org/vogle/sbpayment-java.svg?branch=master)](https://travis-ci.org/vogle/sbpayment-java)
1110
[![Coveralls](https://img.shields.io/coveralls/github/vogle/sbpayment-java.svg)](https://coveralls.io/github/vogle/sbpayment-java?branch=master)
@@ -165,6 +164,7 @@ You will be asked to sign a contribution agreement after creating the first one.
165164

166165
## License
167166
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
167+
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fvogle%2Fsbpayment-java.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fvogle%2Fsbpayment-java?ref=badge_shield)
168168

169169
Copyright 2019 Vogle Labs.
170170

README_JA.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
[![Javadocs](http://javadoc.io/badge/com.vogle.sbpayment/sbpayment-client.svg)](http://javadoc.io/doc/com.vogle.sbpayment/sbpayment-client)
66
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
77
[![Gitter](https://badges.gitter.im/vogle/sbpayment.svg)](https://gitter.im/vogle/sbpayment?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
8-
[![Gradle Scan](https://img.shields.io/badge/Gradle-Scan-blue.svg)](https://vogle.page.link/scan)
98

109
[![Build Status](https://travis-ci.org/vogle/sbpayment-java.svg?branch=master)](https://travis-ci.org/vogle/sbpayment-java)
1110
[![Coveralls](https://img.shields.io/coveralls/github/vogle/sbpayment-java.svg)](https://coveralls.io/github/vogle/sbpayment-java?branch=master)
@@ -160,6 +159,7 @@ See Interface: [PayEasyPayment](sbpayment-payeasy/src/main/java/com/vogle/sbpaym
160159

161160
## ライセンス
162161
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
162+
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fvogle%2Fsbpayment-java.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fvogle%2Fsbpayment-java?ref=badge_shield)
163163

164164
Copyright 2019 Vogle Labs.
165165

build.gradle

+29-36
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ buildScan {
3838
}
3939
}
4040

41-
task('aa') {
42-
print("aaa")
43-
print(project.hasProperty('gitter.url'))
44-
print(project.property('gitter.url'))
45-
}
46-
4741
// Configuration to apply to all the projects
4842
allprojects {
4943

@@ -120,36 +114,6 @@ configure(javaprojects) {
120114
}
121115
}
122116

123-
// Apply sonarqube
124-
apply plugin: 'org.sonarqube'
125-
sonarqube {
126-
properties {
127-
def hasIntegTest = new File(projectDir, 'src/integTest/java').directory
128-
129-
property "sonar.sourceEncoding", "UTF-8"
130-
property "sonar.sources", "src/main/java"
131-
property "sonar.scm.disabled ", "true"
132-
133-
if (hasIntegTest) {
134-
property "sonar.tests", "src/test/java,src/integTest/java"
135-
} else {
136-
property "sonar.tests", "src/test/java"
137-
}
138-
139-
property "sonar.java.coveragePlugin", "jacoco"
140-
if (hasIntegTest) {
141-
property "sonar.jacoco.reportPaths", "build/jacoco/test.exec,build/jacoco/integrationTest.exec"
142-
property "sonar.junit.reportPaths", "build/test-results/test,build/test-results/integrationTest"
143-
} else {
144-
property "sonar.jacoco.reportPaths", "build/jacoco/test.exec"
145-
property "sonar.junit.reportPaths", "build/test-results/test"
146-
}
147-
148-
property "sonar.java.pmd.reportPaths", "build/reports/pmd/main.xml"
149-
property "sonar.java.checkstyle.reportPaths", "build/reports/checkstyle/main.xml"
150-
}
151-
}
152-
153117
}
154118

155119
// Configuration to apply to JAVA Projects
@@ -214,6 +178,35 @@ configure(publishedprojects) {
214178
}
215179
}
216180

181+
// Apply sonarqube
182+
apply plugin: 'org.sonarqube'
183+
sonarqube {
184+
properties {
185+
def hasIntegTest = new File(projectDir, 'src/integTest/java').directory
186+
187+
property "sonar.sourceEncoding", "UTF-8"
188+
property "sonar.sources", "src/main/java"
189+
property "sonar.scm.disabled ", "true"
190+
191+
if (hasIntegTest) {
192+
property "sonar.tests", "src/test/java,src/integTest/java"
193+
} else {
194+
property "sonar.tests", "src/test/java"
195+
}
196+
197+
property "sonar.java.coveragePlugin", "jacoco"
198+
if (hasIntegTest) {
199+
property "sonar.jacoco.reportPaths", "build/jacoco/test.exec,build/jacoco/integrationTest.exec"
200+
property "sonar.junit.reportPaths", "build/test-results/test,build/test-results/integrationTest"
201+
} else {
202+
property "sonar.jacoco.reportPaths", "build/jacoco/test.exec"
203+
property "sonar.junit.reportPaths", "build/test-results/test"
204+
}
205+
206+
property "sonar.java.pmd.reportPaths", "build/reports/pmd/main.xml"
207+
property "sonar.java.checkstyle.reportPaths", "build/reports/checkstyle/main.xml"
208+
}
209+
}
217210
}
218211

219212
// report tools

config/vogle-ruleset-6.7.x.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
<rule ref="category/java/codestyle.xml/EmptyMethodInAbstractClassShouldBeAbstract"/>
9696
<rule ref="category/java/codestyle.xml/ExtendsObject"/>
9797
<rule ref="category/java/codestyle.xml/FieldDeclarationsShouldBeAtStartOfClass"/>
98-
<rule ref="category/java/codestyle.xml/FieldNamingConventions"/>
98+
<!--<rule ref="category/java/codestyle.xml/FieldNamingConventions"/>-->
9999
<rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop"/>
100100
<!--<rule ref="category/java/codestyle.xml/ForLoopsMustUseBraces"/>-->
101101
<rule ref="category/java/codestyle.xml/FormalParameterNamingConventions"/>
@@ -317,7 +317,7 @@
317317
<rule ref="category/java/errorprone.xml/MethodWithSameNameAsEnclosingClass"/>
318318
<rule ref="category/java/errorprone.xml/MisplacedNullCheck"/>
319319
<rule ref="category/java/errorprone.xml/MissingBreakInSwitch"/>
320-
<rule ref="category/java/errorprone.xml/MissingSerialVersionUID"/>
320+
<!-- <rule ref="category/java/errorprone.xml/MissingSerialVersionUID"/>-->
321321
<rule ref="category/java/errorprone.xml/MissingStaticMethodInNonInstantiatableClass"/>
322322
<rule ref="category/java/errorprone.xml/MoreThanOneLogger"/>
323323
<rule ref="category/java/errorprone.xml/NonCaseLabelInSwitchStatement"/>
@@ -357,7 +357,7 @@
357357
<rule ref="category/java/multithreading.xml/DontCallThreadRun"/>
358358
<rule ref="category/java/multithreading.xml/DoubleCheckedLocking"/>
359359
<rule ref="category/java/multithreading.xml/NonThreadSafeSingleton"/>
360-
<rule ref="category/java/multithreading.xml/UnsynchronizedStaticDateFormatter"/>
360+
<!-- <rule ref="category/java/multithreading.xml/UnsynchronizedStaticDateFormatter"/>-->
361361
<!--<rule ref="category/java/multithreading.xml/UseConcurrentHashMap"/>-->
362362
<rule ref="category/java/multithreading.xml/UseNotifyAllInsteadOfNotify"/>
363363

gradle.properties

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
org.gradle.parallel=true
2-
org.gradle.caching=true
32

43
group=com.vogle.sbpayment

sbpayment-client/src/main/java/com/vogle/sbpayment/client/SpsResult.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import lombok.Getter;
2222
import lombok.ToString;
2323

24+
import java.io.Serializable;
2425
import java.util.Map;
2526

2627
/**
@@ -29,7 +30,9 @@
2930
* @author Allan Im
3031
**/
3132
@ToString
32-
public class SpsResult<T extends SpsResponse> {
33+
public class SpsResult<T extends SpsResponse> implements Serializable {
34+
35+
private static final long serialVersionUID = 6757501412149715585L;
3336

3437
/**
3538
* HTTP Status Code

sbpayment-client/src/main/java/com/vogle/sbpayment/client/requests/SpsRequest.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818

1919
import com.vogle.sbpayment.client.responses.SpsResponse;
2020

21+
import java.io.Serializable;
22+
2123
/**
2224
* Request interface
2325
*
2426
* @author Allan Im
2527
**/
26-
public interface SpsRequest<T extends SpsResponse> {
28+
public interface SpsRequest<T extends SpsResponse> extends Serializable {
2729

2830
/**
2931
* Gets a Features ID

sbpayment-client/src/main/java/com/vogle/sbpayment/client/responses/CommonElements.java

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
@Data
2828
public abstract class CommonElements implements SpsResponse {
2929

30+
private static final long serialVersionUID = 1550108062521728517L;
31+
3032
@JacksonXmlProperty(isAttribute = true)
3133
private String id;
3234

sbpayment-client/src/main/java/com/vogle/sbpayment/client/responses/SpsResponse.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616

1717
package com.vogle.sbpayment.client.responses;
1818

19+
import java.io.Serializable;
20+
1921
/**
2022
* Response interface
2123
*
2224
* @author Allan Im
2325
**/
24-
public interface SpsResponse {
26+
public interface SpsResponse extends Serializable {
2527

2628
/**
2729
* Features ID

sbpayment-client/src/test/java/com/vogle/sbpayment/client/SpsClientTest.java

+4
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ private SpsClient createClient(String merchantId, String serviceId) {
240240

241241
public static class TestRequest implements SpsRequest<TestResponse> {
242242

243+
private static final long serialVersionUID = -5028610781660847972L;
244+
243245
private String merchantId;
244246
private String serviceId;
245247
private Integer limitSecond;
@@ -308,6 +310,8 @@ public Class<TestResponse> responseClass() {
308310

309311
public static class TestResponse implements SpsResponse {
310312

313+
private static final long serialVersionUID = -2058777901329574348L;
314+
311315
@Override
312316
public String getId() {
313317
return null;

sbpayment-client/src/test/java/com/vogle/sbpayment/client/convert/SpsDataConverterTest.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@
1919
import lombok.Data;
2020
import lombok.EqualsAndHashCode;
2121
import lombok.ToString;
22+
import org.junit.Test;
2223

2324
import java.nio.charset.Charset;
2425
import java.util.ArrayList;
2526
import java.util.List;
2627

27-
import org.junit.Test;
28-
2928
import static org.assertj.core.api.Assertions.assertThat;
3029

3130
/**
@@ -286,5 +285,9 @@ private class NoGetterObject {
286285
private String cipher;
287286

288287
private String encryptedFlg;
288+
289+
String privateField() {
290+
return some + cipher + encryptedFlg;
291+
}
289292
}
290293
}

sbpayment-creditcard/src/main/java/com/vogle/sbpayment/creditcard/requests/CardAuthorizeRequest.java

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
@JacksonXmlRootElement(localName = "sps-api-request")
5151
public class CardAuthorizeRequest implements SpsRequest<CardAuthorizeResponse> {
5252

53+
private static final long serialVersionUID = 465877331331363736L;
54+
5355
@JacksonXmlProperty(isAttribute = true)
5456
private final String id = "ST01-00131-101";
5557

sbpayment-creditcard/src/main/java/com/vogle/sbpayment/creditcard/requests/CardCancelRequest.java

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
@JacksonXmlRootElement(localName = "sps-api-request")
3939
public class CardCancelRequest implements SpsRequest<DefaultResponse> {
4040

41+
private static final long serialVersionUID = -543077522971686858L;
42+
4143
@JacksonXmlProperty(isAttribute = true)
4244
private final String id = "ST02-00303-101";
4345

sbpayment-creditcard/src/main/java/com/vogle/sbpayment/creditcard/requests/CardCaptureRequest.java

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
@JacksonXmlRootElement(localName = "sps-api-request")
4040
public class CardCaptureRequest implements SpsRequest<DefaultResponse> {
4141

42+
private static final long serialVersionUID = -2015573157616140480L;
43+
4244
@JacksonXmlProperty(isAttribute = true)
4345
private final String id = "ST02-00201-101";
4446

sbpayment-creditcard/src/main/java/com/vogle/sbpayment/creditcard/requests/CardCommitRequest.java

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
@JacksonXmlRootElement(localName = "sps-api-request")
3939
public class CardCommitRequest implements SpsRequest<DefaultResponse> {
4040

41+
private static final long serialVersionUID = -6456887097733052460L;
42+
4143
@JacksonXmlProperty(isAttribute = true)
4244
private final String id = "ST02-00101-101";
4345

sbpayment-creditcard/src/main/java/com/vogle/sbpayment/creditcard/requests/CardInfoDeleteRequest.java

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
@JacksonXmlRootElement(localName = "sps-api-request")
3838
public class CardInfoDeleteRequest implements SpsRequest<CardInfoDeleteResponse> {
3939

40+
private static final long serialVersionUID = 2750844474701499089L;
41+
4042
@JacksonXmlProperty(isAttribute = true)
4143
private final String id = "MG02-00103-101";
4244

sbpayment-creditcard/src/main/java/com/vogle/sbpayment/creditcard/requests/CardInfoLookupRequest.java

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
@JacksonXmlRootElement(localName = "sps-api-request")
3939
public class CardInfoLookupRequest implements SpsRequest<CardInfoLookupResponse> {
4040

41+
private static final long serialVersionUID = -8396000256393924712L;
42+
4143
@JacksonXmlProperty(isAttribute = true)
4244
private final String id = "MG02-00104-101";
4345

sbpayment-creditcard/src/main/java/com/vogle/sbpayment/creditcard/requests/CardInfoSaveRequest.java

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
@JacksonXmlRootElement(localName = "sps-api-request")
4343
public class CardInfoSaveRequest implements SpsRequest<CardInfoSaveResponse> {
4444

45+
private static final long serialVersionUID = -7943963689292565237L;
46+
4547
@JacksonXmlProperty(isAttribute = true)
4648
private final String id = "MG02-00131-101";
4749

sbpayment-creditcard/src/main/java/com/vogle/sbpayment/creditcard/requests/CardInfoUpdateRequest.java

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
@JacksonXmlRootElement(localName = "sps-api-request")
4343
public class CardInfoUpdateRequest implements SpsRequest<CardInfoUpdateResponse> {
4444

45+
private static final long serialVersionUID = 4822517482683433947L;
46+
4547
@JacksonXmlProperty(isAttribute = true)
4648
private final String id = "MG02-00132-101";
4749

sbpayment-creditcard/src/main/java/com/vogle/sbpayment/creditcard/requests/CardPartialRefundRequest.java

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
@JacksonXmlRootElement(localName = "sps-api-request")
4040
public class CardPartialRefundRequest implements SpsRequest<DefaultResponse> {
4141

42+
private static final long serialVersionUID = 8478011947890931234L;
43+
4244
@JacksonXmlProperty(isAttribute = true)
4345
private final String id = "ST02-00307-101";
4446

sbpayment-creditcard/src/main/java/com/vogle/sbpayment/creditcard/requests/CardReauthorizeRequest.java

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
@JacksonXmlRootElement(localName = "sps-api-request")
5151
public class CardReauthorizeRequest implements SpsRequest<CardAuthorizeResponse> {
5252

53+
private static final long serialVersionUID = -3892720023392425048L;
54+
5355
@JacksonXmlProperty(isAttribute = true)
5456
private final String id = "ST01-00133-101";
5557

sbpayment-creditcard/src/main/java/com/vogle/sbpayment/creditcard/requests/CardTranLookupRequest.java

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
@JacksonXmlRootElement(localName = "sps-api-request")
4040
public class CardTranLookupRequest implements SpsRequest<CardTranLookupResponse> {
4141

42+
private static final long serialVersionUID = 8189957339680131672L;
43+
4244
@JacksonXmlProperty(isAttribute = true)
4345
private final String id = "MG01-00101-101";
4446

sbpayment-creditcard/src/main/java/com/vogle/sbpayment/creditcard/requests/LegacyCardAuthorizeRequest.java

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
@JacksonXmlRootElement(localName = "sps-api-request")
5252
public class LegacyCardAuthorizeRequest implements SpsRequest<CardAuthorizeResponse> {
5353

54+
private static final long serialVersionUID = -6508743720832796282L;
55+
5456
@JacksonXmlProperty(isAttribute = true)
5557
private final String id = "ST01-00111-101";
5658

sbpayment-creditcard/src/main/java/com/vogle/sbpayment/creditcard/requests/LegacyCardInfoSaveRequest.java

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
@JacksonXmlRootElement(localName = "sps-api-request")
4444
public class LegacyCardInfoSaveRequest implements SpsRequest<LegacyCardInfoSaveResponse> {
4545

46+
private static final long serialVersionUID = -2123947757052659271L;
47+
4648
@JacksonXmlProperty(isAttribute = true)
4749
private final String id = "MG02-00101-101";
4850

sbpayment-creditcard/src/main/java/com/vogle/sbpayment/creditcard/requests/LegacyCardInfoUpdateRequest.java

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
@JacksonXmlRootElement(localName = "sps-api-request")
4444
public class LegacyCardInfoUpdateRequest implements SpsRequest<LegacyCardInfoUpdateResponse> {
4545

46+
private static final long serialVersionUID = 1793929715634430616L;
47+
4648
@JacksonXmlProperty(isAttribute = true)
4749
private final String id = "MG02-00102-101";
4850

sbpayment-creditcard/src/main/java/com/vogle/sbpayment/creditcard/requests/LegacyCardReauthorizeRequest.java

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
@JacksonXmlRootElement(localName = "sps-api-request")
4949
public class LegacyCardReauthorizeRequest implements SpsRequest<CardAuthorizeResponse> {
5050

51+
private static final long serialVersionUID = -4208920357259615068L;
52+
5153
@JacksonXmlProperty(isAttribute = true)
5254
private final String id = "ST01-00113-101";
5355

0 commit comments

Comments
 (0)