Skip to content

Commit

Permalink
Merge pull request #45 from allanim/master
Browse files Browse the repository at this point in the history
Update Build & Serializable object
  • Loading branch information
allanim committed Apr 1, 2019
2 parents e82ef91 + 11d2191 commit f60baf4
Show file tree
Hide file tree
Showing 39 changed files with 111 additions and 47 deletions.
3 changes: 3 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ plugins:
enabled: true
config:
sonar.java.source: 8
checks:
squid:S1948:
enabled: false
exclude_patterns:
- 'config/'
- '**/dist/'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[![Javadocs](http://javadoc.io/badge/com.vogle.sbpayment/sbpayment-client.svg)](http://javadoc.io/doc/com.vogle.sbpayment/sbpayment-client)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![Gitter](https://badges.gitter.im/vogle/sbpayment.svg)](https://gitter.im/vogle/sbpayment?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Gradle Scan](https://img.shields.io/badge/Gradle-Scan-blue.svg)](https://vogle.page.link/scan)

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

## License
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![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)

Copyright 2019 Vogle Labs.

Expand Down
2 changes: 1 addition & 1 deletion README_JA.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[![Javadocs](http://javadoc.io/badge/com.vogle.sbpayment/sbpayment-client.svg)](http://javadoc.io/doc/com.vogle.sbpayment/sbpayment-client)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![Gitter](https://badges.gitter.im/vogle/sbpayment.svg)](https://gitter.im/vogle/sbpayment?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Gradle Scan](https://img.shields.io/badge/Gradle-Scan-blue.svg)](https://vogle.page.link/scan)

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

## ライセンス
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![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)

Copyright 2019 Vogle Labs.

Expand Down
65 changes: 29 additions & 36 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ buildScan {
}
}

task('aa') {
print("aaa")
print(project.hasProperty('gitter.url'))
print(project.property('gitter.url'))
}

// Configuration to apply to all the projects
allprojects {

Expand Down Expand Up @@ -120,36 +114,6 @@ configure(javaprojects) {
}
}

// Apply sonarqube
apply plugin: 'org.sonarqube'
sonarqube {
properties {
def hasIntegTest = new File(projectDir, 'src/integTest/java').directory

property "sonar.sourceEncoding", "UTF-8"
property "sonar.sources", "src/main/java"
property "sonar.scm.disabled ", "true"

if (hasIntegTest) {
property "sonar.tests", "src/test/java,src/integTest/java"
} else {
property "sonar.tests", "src/test/java"
}

property "sonar.java.coveragePlugin", "jacoco"
if (hasIntegTest) {
property "sonar.jacoco.reportPaths", "build/jacoco/test.exec,build/jacoco/integrationTest.exec"
property "sonar.junit.reportPaths", "build/test-results/test,build/test-results/integrationTest"
} else {
property "sonar.jacoco.reportPaths", "build/jacoco/test.exec"
property "sonar.junit.reportPaths", "build/test-results/test"
}

property "sonar.java.pmd.reportPaths", "build/reports/pmd/main.xml"
property "sonar.java.checkstyle.reportPaths", "build/reports/checkstyle/main.xml"
}
}

}

// Configuration to apply to JAVA Projects
Expand Down Expand Up @@ -214,6 +178,35 @@ configure(publishedprojects) {
}
}

// Apply sonarqube
apply plugin: 'org.sonarqube'
sonarqube {
properties {
def hasIntegTest = new File(projectDir, 'src/integTest/java').directory

property "sonar.sourceEncoding", "UTF-8"
property "sonar.sources", "src/main/java"
property "sonar.scm.disabled ", "true"

if (hasIntegTest) {
property "sonar.tests", "src/test/java,src/integTest/java"
} else {
property "sonar.tests", "src/test/java"
}

property "sonar.java.coveragePlugin", "jacoco"
if (hasIntegTest) {
property "sonar.jacoco.reportPaths", "build/jacoco/test.exec,build/jacoco/integrationTest.exec"
property "sonar.junit.reportPaths", "build/test-results/test,build/test-results/integrationTest"
} else {
property "sonar.jacoco.reportPaths", "build/jacoco/test.exec"
property "sonar.junit.reportPaths", "build/test-results/test"
}

property "sonar.java.pmd.reportPaths", "build/reports/pmd/main.xml"
property "sonar.java.checkstyle.reportPaths", "build/reports/checkstyle/main.xml"
}
}
}

// report tools
Expand Down
6 changes: 3 additions & 3 deletions config/vogle-ruleset-6.7.x.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<rule ref="category/java/codestyle.xml/EmptyMethodInAbstractClassShouldBeAbstract"/>
<rule ref="category/java/codestyle.xml/ExtendsObject"/>
<rule ref="category/java/codestyle.xml/FieldDeclarationsShouldBeAtStartOfClass"/>
<rule ref="category/java/codestyle.xml/FieldNamingConventions"/>
<!--<rule ref="category/java/codestyle.xml/FieldNamingConventions"/>-->
<rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop"/>
<!--<rule ref="category/java/codestyle.xml/ForLoopsMustUseBraces"/>-->
<rule ref="category/java/codestyle.xml/FormalParameterNamingConventions"/>
Expand Down Expand Up @@ -317,7 +317,7 @@
<rule ref="category/java/errorprone.xml/MethodWithSameNameAsEnclosingClass"/>
<rule ref="category/java/errorprone.xml/MisplacedNullCheck"/>
<rule ref="category/java/errorprone.xml/MissingBreakInSwitch"/>
<rule ref="category/java/errorprone.xml/MissingSerialVersionUID"/>
<!-- <rule ref="category/java/errorprone.xml/MissingSerialVersionUID"/>-->
<rule ref="category/java/errorprone.xml/MissingStaticMethodInNonInstantiatableClass"/>
<rule ref="category/java/errorprone.xml/MoreThanOneLogger"/>
<rule ref="category/java/errorprone.xml/NonCaseLabelInSwitchStatement"/>
Expand Down Expand Up @@ -357,7 +357,7 @@
<rule ref="category/java/multithreading.xml/DontCallThreadRun"/>
<rule ref="category/java/multithreading.xml/DoubleCheckedLocking"/>
<rule ref="category/java/multithreading.xml/NonThreadSafeSingleton"/>
<rule ref="category/java/multithreading.xml/UnsynchronizedStaticDateFormatter"/>
<!-- <rule ref="category/java/multithreading.xml/UnsynchronizedStaticDateFormatter"/>-->
<!--<rule ref="category/java/multithreading.xml/UseConcurrentHashMap"/>-->
<rule ref="category/java/multithreading.xml/UseNotifyAllInsteadOfNotify"/>

Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
org.gradle.parallel=true
org.gradle.caching=true

group=com.vogle.sbpayment
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import lombok.Getter;
import lombok.ToString;

import java.io.Serializable;
import java.util.Map;

/**
Expand All @@ -29,7 +30,9 @@
* @author Allan Im
**/
@ToString
public class SpsResult<T extends SpsResponse> {
public class SpsResult<T extends SpsResponse> implements Serializable {

private static final long serialVersionUID = 6757501412149715585L;

/**
* HTTP Status Code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@

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

import java.io.Serializable;

/**
* Request interface
*
* @author Allan Im
**/
public interface SpsRequest<T extends SpsResponse> {
public interface SpsRequest<T extends SpsResponse> extends Serializable {

/**
* Gets a Features ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
@Data
public abstract class CommonElements implements SpsResponse {

private static final long serialVersionUID = 1550108062521728517L;

@JacksonXmlProperty(isAttribute = true)
private String id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@

package com.vogle.sbpayment.client.responses;

import java.io.Serializable;

/**
* Response interface
*
* @author Allan Im
**/
public interface SpsResponse {
public interface SpsResponse extends Serializable {

/**
* Features ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ private SpsClient createClient(String merchantId, String serviceId) {

public static class TestRequest implements SpsRequest<TestResponse> {

private static final long serialVersionUID = -5028610781660847972L;

private String merchantId;
private String serviceId;
private Integer limitSecond;
Expand Down Expand Up @@ -308,6 +310,8 @@ public Class<TestResponse> responseClass() {

public static class TestResponse implements SpsResponse {

private static final long serialVersionUID = -2058777901329574348L;

@Override
public String getId() {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.junit.Test;

import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;

import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;

/**
Expand Down Expand Up @@ -286,5 +285,9 @@ private class NoGetterObject {
private String cipher;

private String encryptedFlg;

String privateField() {
return some + cipher + encryptedFlg;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
@JacksonXmlRootElement(localName = "sps-api-request")
public class CardAuthorizeRequest implements SpsRequest<CardAuthorizeResponse> {

private static final long serialVersionUID = 465877331331363736L;

@JacksonXmlProperty(isAttribute = true)
private final String id = "ST01-00131-101";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
@JacksonXmlRootElement(localName = "sps-api-request")
public class CardCancelRequest implements SpsRequest<DefaultResponse> {

private static final long serialVersionUID = -543077522971686858L;

@JacksonXmlProperty(isAttribute = true)
private final String id = "ST02-00303-101";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
@JacksonXmlRootElement(localName = "sps-api-request")
public class CardCaptureRequest implements SpsRequest<DefaultResponse> {

private static final long serialVersionUID = -2015573157616140480L;

@JacksonXmlProperty(isAttribute = true)
private final String id = "ST02-00201-101";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
@JacksonXmlRootElement(localName = "sps-api-request")
public class CardCommitRequest implements SpsRequest<DefaultResponse> {

private static final long serialVersionUID = -6456887097733052460L;

@JacksonXmlProperty(isAttribute = true)
private final String id = "ST02-00101-101";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
@JacksonXmlRootElement(localName = "sps-api-request")
public class CardInfoDeleteRequest implements SpsRequest<CardInfoDeleteResponse> {

private static final long serialVersionUID = 2750844474701499089L;

@JacksonXmlProperty(isAttribute = true)
private final String id = "MG02-00103-101";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
@JacksonXmlRootElement(localName = "sps-api-request")
public class CardInfoLookupRequest implements SpsRequest<CardInfoLookupResponse> {

private static final long serialVersionUID = -8396000256393924712L;

@JacksonXmlProperty(isAttribute = true)
private final String id = "MG02-00104-101";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
@JacksonXmlRootElement(localName = "sps-api-request")
public class CardInfoSaveRequest implements SpsRequest<CardInfoSaveResponse> {

private static final long serialVersionUID = -7943963689292565237L;

@JacksonXmlProperty(isAttribute = true)
private final String id = "MG02-00131-101";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
@JacksonXmlRootElement(localName = "sps-api-request")
public class CardInfoUpdateRequest implements SpsRequest<CardInfoUpdateResponse> {

private static final long serialVersionUID = 4822517482683433947L;

@JacksonXmlProperty(isAttribute = true)
private final String id = "MG02-00132-101";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
@JacksonXmlRootElement(localName = "sps-api-request")
public class CardPartialRefundRequest implements SpsRequest<DefaultResponse> {

private static final long serialVersionUID = 8478011947890931234L;

@JacksonXmlProperty(isAttribute = true)
private final String id = "ST02-00307-101";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
@JacksonXmlRootElement(localName = "sps-api-request")
public class CardReauthorizeRequest implements SpsRequest<CardAuthorizeResponse> {

private static final long serialVersionUID = -3892720023392425048L;

@JacksonXmlProperty(isAttribute = true)
private final String id = "ST01-00133-101";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
@JacksonXmlRootElement(localName = "sps-api-request")
public class CardTranLookupRequest implements SpsRequest<CardTranLookupResponse> {

private static final long serialVersionUID = 8189957339680131672L;

@JacksonXmlProperty(isAttribute = true)
private final String id = "MG01-00101-101";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
@JacksonXmlRootElement(localName = "sps-api-request")
public class LegacyCardAuthorizeRequest implements SpsRequest<CardAuthorizeResponse> {

private static final long serialVersionUID = -6508743720832796282L;

@JacksonXmlProperty(isAttribute = true)
private final String id = "ST01-00111-101";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
@JacksonXmlRootElement(localName = "sps-api-request")
public class LegacyCardInfoSaveRequest implements SpsRequest<LegacyCardInfoSaveResponse> {

private static final long serialVersionUID = -2123947757052659271L;

@JacksonXmlProperty(isAttribute = true)
private final String id = "MG02-00101-101";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
@JacksonXmlRootElement(localName = "sps-api-request")
public class LegacyCardInfoUpdateRequest implements SpsRequest<LegacyCardInfoUpdateResponse> {

private static final long serialVersionUID = 1793929715634430616L;

@JacksonXmlProperty(isAttribute = true)
private final String id = "MG02-00102-101";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
@JacksonXmlRootElement(localName = "sps-api-request")
public class LegacyCardReauthorizeRequest implements SpsRequest<CardAuthorizeResponse> {

private static final long serialVersionUID = -4208920357259615068L;

@JacksonXmlProperty(isAttribute = true)
private final String id = "ST01-00113-101";

Expand Down
Loading

0 comments on commit f60baf4

Please sign in to comment.