Skip to content

Commit

Permalink
Merge branch 'develop' into feature/improved-esim-batch-management
Browse files Browse the repository at this point in the history
  • Loading branch information
la3lma authored Dec 12, 2019
2 parents 2d80618 + c57c8e0 commit 9dfe0cc
Show file tree
Hide file tree
Showing 91 changed files with 2,462 additions and 2,518 deletions.
13 changes: 2 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ jobs:
# command: |
# scripts/generate-selfsigned-ssl-certs.sh ocs.dev.ostelco.org
# cp certs/ocs.dev.ostelco.org/nginx.crt ocsgw/cert/ocs.crt
# scripts/generate-selfsigned-ssl-certs.sh metrics.dev.ostelco.org
# cp certs/metrics.dev.ostelco.org/nginx.crt ocsgw/cert/metrics.crt

- run:
name: Acceptance Tests
command: docker-compose up --build --abort-on-container-exit
Expand Down Expand Up @@ -260,13 +257,10 @@ jobs:
echo $GOOGLE_DEV_ENDPOINTS_CREDENTIALS > ${HOME}/gcloud-service-key.json
gcloud auth activate-service-account --key-file=${HOME}/gcloud-service-key.json
sed -i 's/GCP_PROJECT_ID/'${DEV_PROJECT}'/g' prime/infra/dev/ocs-api.yaml
sed -i 's/GCP_PROJECT_ID/'${DEV_PROJECT}'/g' prime/infra/dev/metrics-api.yaml
sed -i 's/GCP_PROJECT_ID/'${DEV_PROJECT}'/g' prime/infra/dev/ocs-api.yaml
python -m grpc_tools.protoc --include_imports --include_source_info --proto_path=ocs-grpc-api/src/main/proto --descriptor_set_out=ocs_descriptor.pb ocs.proto
python -m grpc_tools.protoc --include_imports --include_source_info --proto_path=analytics-grpc-api/src/main/proto --descriptor_set_out=metrics_descriptor.pb prime_metrics.proto
gcloud endpoints services deploy ocs_descriptor.pb prime/infra/dev/ocs-api.yaml
gcloud endpoints services deploy metrics_descriptor.pb prime/infra/dev/metrics-api.yaml
gcloud endpoints services deploy prime/infra/dev/prime-customer-api.yaml
gcloud endpoints services deploy prime/infra/dev/prime-webhooks.yaml
gcloud endpoints services deploy prime/infra/dev/prime-houston-api.yaml
Expand Down Expand Up @@ -327,13 +321,10 @@ jobs:
echo $GOOGLE_PROD_ENDPOINTS_CREDENTIALS > ${HOME}/gcloud-service-key.json
gcloud auth activate-service-account --key-file=${HOME}/gcloud-service-key.json
sed -i 's/GCP_PROJECT_ID/'${PROD_PROJECT}'/g' prime/infra/prod/ocs-api.yaml
sed -i 's/GCP_PROJECT_ID/'${PROD_PROJECT}'/g' prime/infra/prod/metrics-api.yaml
sed -i 's/GCP_PROJECT_ID/'${PROD_PROJECT}'/g' prime/infra/prod/ocs-api.yaml
python -m grpc_tools.protoc --include_imports --include_source_info --proto_path=ocs-grpc-api/src/main/proto --descriptor_set_out=ocs_descriptor.pb ocs.proto
python -m grpc_tools.protoc --include_imports --include_source_info --proto_path=analytics-grpc-api/src/main/proto --descriptor_set_out=metrics_descriptor.pb prime_metrics.proto
gcloud endpoints services deploy ocs_descriptor.pb prime/infra/prod/ocs-api.yaml
gcloud endpoints services deploy metrics_descriptor.pb prime/infra/prod/metrics-api.yaml
gcloud endpoints services deploy prime/infra/prod/prime-customer-api.yaml
gcloud endpoints services deploy prime/infra/prod/prime-webhooks.yaml
gcloud endpoints services deploy prime/infra/prod/prime-houston-api.yaml
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.3.60-blue.svg)](http://kotlinlang.org/)
[![Kotlin version badge](https://img.shields.io/badge/kotlin-1.3.61-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
46 changes: 46 additions & 0 deletions acceptance-tests/src/main/kotlin/org/ostelco/at/jersey/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import kotlin.test.assertFails
import kotlin.test.assertNotNull
import kotlin.test.assertNull
import kotlin.test.assertTrue
import kotlin.test.fail


class CustomerTest {
Expand Down Expand Up @@ -283,6 +284,51 @@ class RegionsTest {
StripePayment.deleteCustomer(customerId = customerId)
}
}
@Test
fun `jersey test - POST support simprofile - Sim profile from houston`() {

val email = "regions-${randomInt()}@test.com"
var customerId = ""
try {
customerId = createCustomer(name = "Test Single Region User", email = email).id
enableRegion(email = email)

var regionDetailsList: Collection<RegionDetails> = get {
path = "/regions"
this.email = email
}

assertEquals(2, regionDetailsList.size, "Customer should have 2 regions")
var receivedRegion = regionDetailsList.find { it.status == APPROVED }
?: fail("Failed to find an approved region.")
val regionCode = receivedRegion.region.id
val simProfile = post<SimProfile> {
path = "/support/simprofile/$customerId"
this.email = email
this.queryParams = mapOf("regionCode" to regionCode, "profileType" to "iphone", "alias" to "")
}

regionDetailsList = get {
path = "/regions"
this.email = email
}
// Find the same Region
receivedRegion = regionDetailsList.find { it.region.id == regionCode }
?: fail("Failed to find the region used to create sim profile.")

assertEquals(
1,
receivedRegion.simProfiles.size,
"Should have only one sim profile")

assertNotNull(receivedRegion.simProfiles.single().iccId)
assertEquals("", receivedRegion.simProfiles.single().alias)
assertNotNull(receivedRegion.simProfiles.single().eSimActivationCode)
assertEquals(simProfile.iccId, receivedRegion.simProfiles.single().iccId)
} finally {
StripePayment.deleteCustomer(customerId = customerId)
}
}
}

class SubscriptionsTest {
Expand Down
1 change: 0 additions & 1 deletion analytics-grpc-api/README.md

This file was deleted.

58 changes: 0 additions & 58 deletions analytics-grpc-api/build.gradle.kts

This file was deleted.

20 changes: 0 additions & 20 deletions analytics-grpc-api/src/main/proto/analytics.proto

This file was deleted.

27 changes: 0 additions & 27 deletions analytics-grpc-api/src/main/proto/prime_metrics.proto

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@ class AnalyticsModule : PrimeModule {

CustomMetricsRegistry.init(env.metrics())

val server = AnalyticsGrpcServer(8083, AnalyticsGrpcService())

env.lifecycle().manage(server)

// dropwizard starts Analytics events publisher
env.lifecycle().manage(ActiveUsersPublisher)
env.lifecycle().manage(DataConsumptionInfoPublisher)
env.lifecycle().manage(PurchasePublisher)
env.lifecycle().manage(RefundPublisher)
Expand All @@ -47,10 +42,6 @@ data class AnalyticsConfig(
@JsonProperty("purchaseInfoTopicId")
val purchaseInfoTopicId: String,

@NotBlank
@JsonProperty("activeUsersTopicId")
val activeUsersTopicId: String,

@NotBlank
@JsonProperty("simProvisioningTopicId")
val simProvisioningTopicId: String,
Expand Down
Loading

0 comments on commit 9dfe0cc

Please sign in to comment.