Skip to content

Commit

Permalink
Travis final landing (#49)
Browse files Browse the repository at this point in the history
* Add .travis.yml

* WePay Initialize test

* Add configuration for unit test

* Update client parameters

* Add encryped env value for client secret in unit test

* Update security env

* Test global env

* Add app client id to env variable

* Update secure value

* Change security and app
  • Loading branch information
hellenyue002 committed Apr 28, 2017
1 parent 7bb662c commit bea1853
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
@@ -0,0 +1,10 @@
language: java
install: mvn clean install
notifications:
email:
on_success: never
sudo: false
env:
global:
- appClientId=171482
- secure: ldQy23GREhK7UT2nhnUBVJs6xTgVfW7gWmZBP3fWk5GECSQBKSXzAmGNUQsMJ6N1CA7mFJ0yHS3npcbAmeInrbSsKiFAf4OeNjIkpaarFSK8LjI10XdBWEW+8Bx+U2/iPja8Il9pb1vNXmzrUYZ++nxUB0HuUs5YGeIl7cS1mF0=
6 changes: 6 additions & 0 deletions pom.xml
Expand Up @@ -45,6 +45,12 @@
<artifactId>json</artifactId>
<version>20141113</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
26 changes: 26 additions & 0 deletions src/test/java/com/wepay/BaseWePayTest.java
@@ -0,0 +1,26 @@
package com.wepay;

import com.wepay.WePay; // WePay object needed for API initialization
import com.wepay.model.*; // contains call classes and all API call functions
import com.wepay.model.data.*; // contains all data objects needed for making calls
import com.wepay.net.WePayResource; // network resource used to execute calls
import com.wepay.exception.WePayException; // handles WePay exceptions
import org.json.*; // SDK uses JSON when handling API call parameters
import com.google.gson.*; // SDK uses GSON for building objects from API responses
import org.junit.Assert;
import org.junit.Test;

public class BaseWePayTest {
public static WePay wepay;

@Test
public void testInitialize() {
String appClient = System.getenv("appClientId");
Long appClientId = (appClient == null) ? (long)171482 : Long.parseLong(appClient);
String appClientSecret = System.getenv("appClientSecret");
WePay.initialize(appClientId, appClientSecret, true);
Assert.assertEquals(appClientId, WePay.clientId);
}


}

0 comments on commit bea1853

Please sign in to comment.