Skip to content

Commit

Permalink
Merge pull request #346 from ostelco/develop
Browse files Browse the repository at this point in the history
prime-1.16.0
  • Loading branch information
vihangpatil authored Sep 29, 2018
2 parents bb5f230 + e87312f commit 7c982fd
Show file tree
Hide file tree
Showing 114 changed files with 2,004 additions and 644 deletions.
25 changes: 16 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
git checkout ${CIRCLE_BRANCH}
git checkout develop
git merge ${CIRCLE_BRANCH} -m "Merging ${CIRCLE_BRANCH} into develop."
# Show the java version installed.
- run: java -version
# Show the javac version installed.
- run: javac -version

- run:
name: Pulling Gradle cache
Expand All @@ -39,7 +39,13 @@ jobs:
- run:
name: Build entire repo
command: ./gradlew clean build -info -s -x :neo4j-store:test

- run:
name: Push Gradle cache
command: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -fr ~/.gradle/caches/*/plugin-resolution/
tar -czvf ~/caches.tar.gz -C ~/.gradle/caches .
gsutil cp ~/caches.tar.gz gs://pi-ostelco-core-gradle-cache
# persisting the entire project with its generated artifacts. They are needed in the build-image job below.
# the default working directory in circleci is ~/project/
- persist_to_workspace:
Expand Down Expand Up @@ -72,7 +78,7 @@ jobs:
CODACY_MODULE: com.codacy.CodacyCoverageReporter

docker:
- image: circleci/openjdk:8u171-jdk
- image: circleci/openjdk:11-jdk-sid

steps:
- run:
Expand All @@ -97,8 +103,9 @@ jobs:

### JOBS FOR on-PR-merge-to-dev PIPELINE
build-code:
machine:
enabled: true

docker:
- image: circleci/openjdk:11-jdk-sid

steps:
- checkout
Expand Down Expand Up @@ -342,9 +349,9 @@ workflows:
- deploy-to-dev:
requires:
- update-dev-endpoints
- create-PR-to-master:
requires:
- deploy-to-dev
# - create-PR-to-master:
# requires:
# - deploy-to-dev

deploy-to-prod:
jobs:
Expand Down
1 change: 1 addition & 0 deletions .circleci/prime-dev-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ prime:
STRIPE_API_KEY: ""
DATA_TRAFFIC_TOPIC: "data-traffic"
PURCHASE_INFO_TOPIC: "purchase-info"
ACTIVE_USERS_TOPIC: "active-users"
ports:
- 8080
- 8081
Expand Down
1 change: 1 addition & 0 deletions .circleci/prime-prod-values-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ prime:
STRIPE_API_KEY: ""
DATA_TRAFFIC_TOPIC: "data-traffic"
PURCHASE_INFO_TOPIC: "purchase-info"
ACTIVE_USERS_TOPIC: "active-users"
ports:
- 8080
- 8081
Expand Down
1 change: 1 addition & 0 deletions .circleci/prime-prod-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ prime:
STRIPE_API_KEY: ""
DATA_TRAFFIC_TOPIC: "data-traffic"
PURCHASE_INFO_TOPIC: "purchase-info"
ACTIVE_USERS_TOPIC: "active-users"

ports:
- 8080
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

[![Kotlin version badge](https://img.shields.io/badge/kotlin-1.2.70-blue.svg)](http://kotlinlang.org/)
[![Kotlin version badge](https://img.shields.io/badge/kotlin-1.2.71-blue.svg)](http://kotlinlang.org/)
[![Prime version](https://img.shields.io/github/tag/ostelco/ostelco-core.svg)](https://github.com/ostelco/ostelco-core/tags)
[![GitHub license](https://img.shields.io/github/license/ostelco/ostelco-core.svg)](https://github.com/ostelco/ostelco-core/blob/master/LICENSE)

Expand Down
2 changes: 1 addition & 1 deletion acceptance-tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM azul/zulu-openjdk:8u181-8.31.0.1
FROM openjdk:11

MAINTAINER CSI "[email protected]"

Expand Down
4 changes: 2 additions & 2 deletions acceptance-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.2.70"
id "org.jetbrains.kotlin.jvm" version "1.2.71"
id "application"
id "com.github.johnrengelman.shadow" version "2.0.4"
id "com.github.johnrengelman.shadow" version "4.0.0"
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,6 @@ object StripePayment {
return token.card.id
}

fun getCardIdForSourceId(sourceId: String) : String {

// https://stripe.com/docs/api/java#create_source
Stripe.apiKey = System.getenv("STRIPE_API_KEY")

val source = Source.retrieve(sourceId)
return source.id
}

/**
* Obtains 'default source' directly from Stripe. Use in tests to
* verify that the correspondng 'setDefaultSource' API works as
Expand Down Expand Up @@ -91,15 +82,11 @@ object StripePayment {
return customers.filter { it.email.equals(email) }.first().id
}

fun deleteAllCustomers() {
fun deleteCustomer(email: String) {
// https://stripe.com/docs/api/java#create_card_token
Stripe.apiKey = System.getenv("STRIPE_API_KEY")

do {
val customers = Customer.list(emptyMap()).data
customers.forEach { customer ->
customer.delete()
}
} while (customers.isNotEmpty())
val customers = Customer.list(emptyMap()).data
customers.filter { it.email == email }
.forEach { it.delete() }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fun createProfile(name: String, email: String) {
.name(name)
.address("")
.city("")
.country("")
.country("NO")
.postCode("")
.referralId("")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ inline fun <reified T> put(execute: HttpRequest.() -> Unit): T {
return response.readEntity(object : GenericType<T>() {})
}

/**
* DSL function for DELETE operation
*/
inline fun <reified T> delete(execute: HttpRequest.() -> Unit): T {
val request = HttpRequest().apply(execute)
val response = HttpClient.send(request.path, request.queryParams, request.headerParams, request.subscriberId)
.delete()
assertEquals(200, response.status) { response.readEntity(String::class.java) }
return response.readEntity(object : GenericType<T>() {})
}

fun <T> assertEquals(expected: T, actual: T, lazyMessage: () -> String) {
var message = ""
if (expected != actual) {
Expand Down
Loading

0 comments on commit 7c982fd

Please sign in to comment.