{"id":19891377,"url":"https://github.com/lightbend/kalix-ws-loan-application-java","last_synced_at":"2025-09-18T21:32:09.121Z","repository":{"id":39186719,"uuid":"498453647","full_name":"lightbend/kalix-ws-loan-application-java","owner":"lightbend","description":null,"archived":false,"fork":false,"pushed_at":"2022-06-01T14:11:57.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-11-12T18:18:02.611Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lightbend.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-31T18:31:54.000Z","updated_at":"2022-05-31T18:32:11.000Z","dependencies_parsed_at":"2022-09-26T19:43:36.108Z","dependency_job_id":null,"html_url":"https://github.com/lightbend/kalix-ws-loan-application-java","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightbend%2Fkalix-ws-loan-application-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightbend%2Fkalix-ws-loan-application-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightbend%2Fkalix-ws-loan-application-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightbend%2Fkalix-ws-loan-application-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lightbend","download_url":"https://codeload.github.com/lightbend/kalix-ws-loan-application-java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233525954,"owners_count":18689407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T18:18:03.824Z","updated_at":"2025-09-18T21:32:03.795Z","avatar_url":"https://github.com/lightbend.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kalix Workshop - Loan application - Java\nNot supported by Lightbend in any conceivable way, not open for contributions.\n\n## Prerequisite\nJava 11 or later\u003cbr\u003e\nApache Maven 3.6 or higher\u003cbr\u003e\n[Kalix CLI](https://docs.kalix.io/kalix/install-kalix.html) \u003cbr\u003e\nDocker 20.10.8 or higher (client and daemon)\u003cbr\u003e\nContainer registry with public access (like Docker Hub)\u003cbr\u003e\nAccess to the `gcr.io/kalix-public` container registry\u003cbr\u003e\ncURL\u003cbr\u003e\nIDE / editor\u003cbr\u003e\n\n## Create kickstart maven project\n\n```\nmvn archetype:generate \\\n-DarchetypeGroupId=io.kalix \\\n-DarchetypeArtifactId=kalix-maven-archetype \\\n-DarchetypeVersion=LATEST\n```\nDefine value for property 'groupId': `io.kx`\u003cbr\u003e\nDefine value for property 'artifactId': `loan-application`\u003cbr\u003e\nDefine value for property 'version' 1.0-SNAPSHOT: :\u003cbr\u003e\nDefine value for property 'package' io.kx: : `io.kx.loanapp`\u003cbr\u003e\n\n## Import generated project in your IDE/editor\n\u003ci\u003e\u003cb\u003eDelete all proto files after done\u003c/b\u003e\u003c/i\u003e\n\n## Update main class\nIn `pom.xml`:\n1. In `\u003cmainClass\u003eio.kx.loanapp.Main\u003c/mainClass\u003e` replace `io.kx.loanapp.Main` with `io.kx.Main`\n2. In `\u003cdockerImage\u003emy-docker-repo/${project.artifactId}\u003c/dockerImage\u003e` replace `my-docker-repo` with the right `dockerId`\n\n\n# Loan application service\n\n## Define API data structure and endpoints (GRPC)\nCreate `io/kx/loanapp/api` folder in `src/main/proto` folder. \u003cbr\u003e\nCreate `loan_app_api.proto` in `src/main/proto/io/kx/loanapp/api` folder. \u003cbr\u003e\nCreate: \u003cbr\u003e\n- headers\n- state\n- commands\n- service\n\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: Check content in `step-1` git branch\n\n## Define persistence (domain) data structure  (GRPC)\nCreate `io/kx/loanapp/doman` folder in `src/main/proto` folder. \u003cbr\u003e\nCreate `loan_app_domain.proto` in `src/main/proto/io/kx/loanapp/domain` folder. \u003cbr\u003e\nCreate: \u003cbr\u003e\n- headers\n- state\n- events\n\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: Check content in `step-1` git branch\n## Add codegen annotations in API data structure and endpoints (GRPC)\nIn `src/main/proto/io/kx/loanapp/api/loan_app_api.proto` add AkkaServerless codegen annotations to GRPC service\n```\nservice LoanAppService {\n```\n```\noption (kalix.codegen) = {\n    event_sourced_entity: {\n      name: \"io.kx.loanapp.domain.LoanAppEntity\"\n      entity_type: \"loanapp\"\n      state: \"io.kx.loanapp.domain.LoanAppDomainState\"\n      events: [\n        \"io.kx.loanapp.domain.Submitted\",\n        \"io.kx.loanapp.domain.Approved\",\n        \"io.kx.loanapp.domain.Declined\"\n      ]\n    }\n  };\n```\n```\n...\n```\n\u003ci\u003e\u003cb\u003eNote\u003c/b\u003e\u003c/i\u003e: `event_sourced_entity.name` has to be a unique name\n## Compile maven project to trigger codegen\n```\nmvn compile\n```\nCompile will generate help classes (`target/generated-*` folders) and skeleton classes\u003cbr\u003e\u003cbr\u003e\nBusiness logic:\u003cbr\u003e\n`src/main/java/io/kx/Main`\u003cbr\u003e\n`src/main/java/io/kx/loanapp/domain/LoanAppEntity`\u003cbr\u003e\n\u003cbr\u003e\nUnit tests:\u003cbr\u003e\n`src/test/java/io/kx/loanapp/domain/LoanAppEntityTest`\u003cbr\u003e\nIntegration tests:\u003cbr\u003e\n`src/it/java/io/kx/loanapp/api/LoanAppEntityIntegrationTest`\u003cbr\u003e\n\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: If required reimport/re-sync project in your IDE\n## Implement entity skeleton class\nImplement `src/main/java/io/kx/loanapp/domain/LoanAppEntity` class \u003cbr\u003e\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: Check content in `step-1` git branch\n\n## Implement unit test\nImplement  `src/test/java/io/kx/loanapp/domain/LoanAppEntityTest` class\u003cbr\u003e\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: Check content in `step-1` git branch\n\n## Run unit test\n```\nmvn test\n```\n## Implement integration test\nImplement `src/it/java/io/kx/loanapp/api/LoanAppEntityIntegrationTest` class\u003cbr\u003e\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: Check content in `step-1` git branch\n\n## Run integration test\n```\nmvn -Pit verify\n```\n\n\u003ci\u003e\u003cb\u003eNote\u003c/b\u003e\u003c/i\u003e: Integration tests uses [TestContainers](https://www.testcontainers.org/) to span integration environment so it could require some time to download required containers.\nAlso make sure docker is running.\n\n## Run locally\n\nIn project root folder there is `docker-compose.yaml` for running `kalix proxy` and (optionally) `google pubsub emulator`.\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: If you do not require google pubsub emulator then comment it out in `docker-compose.yaml`\n```\ndocker-compose up\n```\n\nStart the service:\n\n```\nmvn compile exec:exec\n```\n\n## Test service locally\nSubmit loan application:\n```\ncurl -XPOST -d '{\n  \"client_id\": \"12345\",\n  \"client_monthly_income_cents\": 60000,\n  \"loan_amount_cents\": 20000,\n  \"loan_duration_months\": 12\n}' http://localhost:9000/loanapp/1 -H \"Content-Type: application/json\"\n```\n\nGet loan application:\n```\ncurl -XGET http://localhost:9000/loanapp/1 -H \"Content-Type: application/json\"\n```\n\nApprove:\n```\ncurl -XPUT http://localhost:9000/loanapp/1/approve -H \"Content-Type: application/json\"\n```\n\n## Package\n\n\u003ci\u003e\u003cb\u003eNote\u003c/b\u003e\u003c/i\u003e: Make sure you have updated `dockerImage` in your `pom.xml` and that your local docker is authenticated with your docker container registry\n\n```\nmvn package\n```\n\n\u003cbr\u003e\u003cbr\u003e\n\nPush docker image to docker repository:\n```\nmvn docker:push\n```\n\n## Register for Kalix account or Login with existing account\n[Register](https://console.kalix.io/register)\n\n## kalix CLI\nValidate version:\n```\nkalix version\n```\nLogin (need to be logged in the Kalix Console in web browser):\n```\nkalix auth login\n```\nCreate new project:\n```\nkalix projects new loan-application --region \u003cREGION\u003e\n```\n\u003ci\u003e\u003cb\u003eNote\u003c/b\u003e\u003c/i\u003e: Replace `\u003cREGION\u003e` with desired region\n\nList projects:\n```\nkalix projects list\n```\nSet project:\n```\nkalix config set project loan-application\n```\n## Deploy service\n```\nkalix service deploy loan-application my-docker-repo/loan-application:1.0-SNAPSHOT\n```\n\u003ci\u003e\u003cb\u003eNote\u003c/b\u003e\u003c/i\u003e: Replace `my-docker-repo` with your docker repository\n\nList services:\n```\nkalix services list\n```\n```\nNAME               AGE    REPLICAS   STATUS   DESCRIPTION   \nloan-application   102s   1          Ready  \n```\n## Expose service\n```\nkalix services expose loan-application\n```\nResult:\n`\nService 'loan-application' was successfully exposed at: \u003csome_host\u003e.us-east1.kalix.app\n`\n## Test service in production\nSubmit loan application:\n```\ncurl -XPOST -d '{\n  \"client_id\": \"12345\",\n  \"client_monthly_income_cents\": 60000,\n  \"loan_amount_cents\": 20000,\n  \"loan_duration_months\": 12\n}' https://\u003csomehost\u003e.kalix.app/loanapp/1 -H \"Content-Type: application/json\"\n```\nGet loan application:\n```\ncurl -XGET https://\u003csomehost\u003e.kalix.app/loanapp/1 -H \"Content-Type: application/json\"\n```\nApprove:\n```\ncurl -XPUT https://\u003csomehost\u003e.kalix.app/loanapp/1/approve -H \"Content-Type: application/json\"\n```\n\n# Loan application processing service\n\n## Increment version\nIn `pom.xml` in `\u003cversion\u003e1.0-SNAPSHOT\u003c/version\u003e` replace `1.0-SNAPSHOT` with `1.1-SNAPSHOT`\n\n## Define API data structure and endpoints (GRPC)\nCreate `io/kx/loanproc/api` folder in `src/main/proto` folder. \u003cbr\u003e\nCreate `loan_proc_api.proto` in `src/main/proto/io/kx/loanproc/api` folder. \u003cbr\u003e\nCreate: \u003cbr\u003e\n- state\n- commands\n- service\n\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: Check content in `step-2` git branch\n\n## Define persistence (domain) data structure  (GRPC)\nCreate `io/kx/loanproc/domain` folder in `src/main/proto` folder. \u003cbr\u003e\nCreate `loan_proc_domain.proto` in `src/main/proto/io/kx/loanproc/domain` folder. \u003cbr\u003e\nCreate: \u003cbr\u003e\n- state\n- events\n\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: Check content in `step-2` git branch\n## Add codegen annotations in API data structure and endpoints (GRPC)\nIn `src/main/proto/io/kx/loanproc/api/loan_proc_api.proto` add AkkaServerless codegen annotations to GRPC service\n```\nservice LoanProcService {\n```\n```\noption (kalix.codegen) = {\n    event_sourced_entity: {\n      name: \"io.kx.loanproc.domain.LoanProcEntity\"\n      entity_type: \"loanproc\"\n      state: \"io.kx.loanproc.domain.LoanProcDomainState\"\n      events: [\n        \"io.kx.loanproc.domain.ReadyForReview\",\n        \"io.kx.loanproc.domain.Approved\",\n        \"io.kx.loanproc.domain.Declined\"\n      ]\n    }\n  };\n```\n```\n...\n```\n\u003ci\u003e\u003cb\u003eNote\u003c/b\u003e\u003c/i\u003e: `event_sourced_entity.name` has to be a unique name\n## Compile maven project to trigger codegen\n```\nmvn compile\n```\n\nCompile will generate help classes (`target/generated-*` folders) and skeleton classes\u003cbr\u003e\u003cbr\u003e\nBusiness logic:\u003cbr\u003e\n`src/main/java/io/kx/loanproc/domain/LoanProcEntity`\u003cbr\u003e\n\u003cbr\u003e\nUnit tests:\u003cbr\u003e\n`src/test/java/io/kx/loanproc/domain/LoanProcEntityTest`\u003cbr\u003e\nIntegration tests:\u003cbr\u003e\n`src/it/java/io/kx/loanproc/api/LoanProcEntityIntegrationTest`\u003cbr\u003e\n\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: If required reimport project in your IDE\n\n## Update Main class\nIn `src/main/java/io/kx/Main` you need to add new entity component (`LoanProcEntity`):\n```\n return AkkaServerlessFactory.withComponents(LoanAppEntity::new, LoanProcEntity::new);\n```\n## Implement entity skeleton class\nImplement `src/main/java/io/kx/loanproc/domain/LoanProcEntity` class\u003cbr\u003e\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: Check content in `step-2` git branch\n\n## Implement unit test\nImplement `src/test/java/io/kx/loanproc/domain/LoanProcEntityTest` class\u003cbr\u003e\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: Check content in `step-2` git branch\n\n## Run unit test\n```\nmvn test\n```\n## Implement integration test\nImplement `src/it/java/io/kx/loanproc/api/LoanProcEntityIntegrationTest` class\u003cbr\u003e\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: Check content in `step-2` git branch\n\n## Run integration test\n```\nmvn -Pit verify\n```\n\n\u003ci\u003e\u003cb\u003eNote\u003c/b\u003e\u003c/i\u003e: Integration tests uses [TestContainers](https://www.testcontainers.org/) to span integration environment so it could require some time to download required containers.\nAlso make sure docker is running.\n\n## Run locally\n\nIn project root folder there is `docker-compose.yaml` for running `kalix proxy` and (optionally) `google pubsub emulator`.\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: If you do not require google pubsub emulator then comment it out in `docker-compose.yaml`\n```\ndocker-compose up\n```\n\nStart the service:\n\n```\nmvn compile exec:exec\n```\n\n## Test service locally\nStart processing:\n```\ncurl -XPOST -d '{\n  \"client_monthly_income_cents\": 60000,\n  \"loan_amount_cents\": 20000,\n  \"loan_duration_months\": 12\n}' http://localhost:9000/loanproc/1 -H \"Content-Type: application/json\"\n```\n\nGet loan processing:\n```\ncurl -XGET http://localhost:9000/loanproc/1 -H \"Content-Type: application/json\"\n```\n\nApprove:\n```\ncurl -XPUT http://localhost:9000/loanproc/1/approve -H \"Content-Type: application/json\"\n```\n\n## Package\n\n```\nmvn package\n```\n\u003cbr\u003e\u003cbr\u003e\n\nPush docker image to docker repository:\n```\nmvn docker:push\n```\n## Deploy service\n```\nkalix service deploy loan-application my-docker-repo/loan-application:1.1-SNAPSHOT\n```\n## Test service in production\nStart processing:\n```\ncurl -XPOST -d '{\n  \"client_monthly_income_cents\": 60000,\n  \"loan_amount_cents\": 20000,\n  \"loan_duration_months\": 12\n}' https://\u003csomehost\u003e.kalix.app/loanproc/1 -H \"Content-Type: application/json\"\n```\n\nGet loan processing:\n```\ncurl -XGET https://\u003csomehost\u003e.kalix.app/loanproc/1 -H \"Content-Type: application/json\"\n```\n\nApprove:\n```\ncurl -XPUT https://\u003csomehost\u003e.kalix.app/loanproc/1/approve -H \"Content-Type: application/json\"\n```\n## Increment version\nIn `pom.xml` in `\u003cversion\u003e1.1-SNAPSHOT\u003c/version\u003e` replace `1.1-SNAPSHOT` with `1.2-SNAPSHOT`\n\n## Create a view\nCreate `io/kx/loanproc/view` folder in `src/main/proto` folder. \u003cbr\u003e\nCreate `loan_proc_by_status_view.proto` in `src/main/proto/io/kx/loanproc/view` folder. \u003cbr\u003e\nCreate: \u003cbr\u003e\n- state\n- request/response\n- service\n\n\u003ci\u003e\u003cb\u003eNote\u003c/b\u003e\u003c/i\u003e: `SELECT` result alias `AS results` needs to correspond with `GetLoanProcByStatusResponse` parameter name `repeated LoanProcViewState results`\u003cbr\u003e\n\u003ci\u003e\u003cb\u003eNote\u003c/b\u003e\u003c/i\u003e: Currently `enums` are not supported as query parameters ([issue 1141](https://github.com/lightbend/kalix-proxy/issues/1141)) so enum `number` value is used for query\u003cbr\u003e\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: Check content in `step-3` git branch\n\n## Compile maven project to trigger codegen for views\n```\nmvn compile\n```\n\nCompile will generate help classes (`target/generated-*` folders) and skeleton classes\u003cbr\u003e\u003cbr\u003e\n\n`src/main/java/io/kx/loanproc/view/LoanProcByStatusView`\u003cbr\u003e\n\nIn `src/main/java/io/kx/Main` you need to add view (`LoanProcByStatusView`) initialization:\n```\n return AkkaServerlessFactory.withComponents(LoanAppEntity::new, LoanProcEntity::new, LoanProcByStatusView::new);\n```\n\n## Implement view LoanProcByStatusView skeleton class\nImplement `src/main/java/io/kx/loanproc/view/LoanProcByStatusView` class\u003cbr\u003e\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: Check content in `step-3` git branch\n\n##Unit test\n\nBecause of the nature of views only Integration tests are done.\n\n## Create integration tests for view\n1. Copy `io/kx/loanproc/view/LoanProcEntityIntegrationTest` class to `io/kx/loanproc/view/LoanProcViewIntegrationTest`\n2. Remove all methods annotated with `@Test`\n3. Add test case\n```\n@Test\npublic void viewTest() throws Exception {\n...  \n```\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: Check content in `step-3` git branch\n\n## Run integration test\n```\nmvn verify -Pit\n```\n\n\u003ci\u003e\u003cb\u003eNote\u003c/b\u003e\u003c/i\u003e: Integration tests uses [TestContainers](https://www.testcontainers.org/) to span integration environment so it could require some time to download required containers.\nAlso make sure docker is running.\n\n\n## Package\n\n```\nmvn package\n```\n\u003cbr\u003e\u003cbr\u003e\n\nPush docker image to docker repository:\n```\nmvn docker:push\n```\n## Deploy service\n```\nkalix service deploy loan-application my-docker-repo/loan-application:1.2-SNAPSHOT\n```\n\n## Test service in production\nGet loan processing by status:\n```\ncurl -XPOST -d {\"status_id\":2} https://\u003csomehost\u003e.kalix.app/loanproc/views/by-status -H \"Content-Type: application/json\"\n```\n\n# Event driven communication\n\n## Increment version\nIn `pom.xml` in `\u003cversion\u003e1.2-SNAPSHOT\u003c/version\u003e` replace `1.3-SNAPSHOT` with `1.3-SNAPSHOT`\n\n## Action for submitted event (Loan application service -\u003e Loan application processing service)\nCreate `io/kx/loanapp/action` folder in `src/main/proto` folder. \u003cbr\u003e\nCreate `loan_app_eventing_to_proc_action.proto` in `src/main/proto/io/kx/loanapp/action` folder. \u003cbr\u003e\nCreate: \u003cbr\u003e\n- service\n\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: Check content in `step-4` git branch\n\n## Action for approved \u0026 declined processing event (Loan application processing service -\u003e Loan application service)\nCreate `io/kx/loanproc/action` folder in `src/main/proto` folder. \u003cbr\u003e\nCreate `loan_proc_eventing_to_app_action.proto` in `src/main/proto/io/kx/loanproc/action` folder. \u003cbr\u003e\nCreate: \u003cbr\u003e\n- service\n\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: Check content in `step-4` git branch\n\n## Compile maven project to trigger codegen for action\n```\nmvn compile\n```\nCompile will generate help classes (`target/generated-*` folders) and skeleton classes\u003cbr\u003e\u003cbr\u003e\n\n`src/main/java/io/kx/loanapp/action/LoanAppEventingToProcAction`\u003cbr\u003e\n`src/main/java/io/kx/loanproc/action/LoanProcEventingToAppAction`\u003cbr\u003e\n\nIn `src/main/java/io/kx/Main` you need to add view (`LoanAppEventingToProcAction` \u0026 `LoanProcEventingToAppAction`) initialization:\n```\n return AkkaServerlessFactory.withComponents(LoanAppEntity::new, LoanProcEntity::new, LoanAppEventingToProcAction::new, LoanProcByStatusView::new, LoanProcEventingToAppAction::new);\n```\n## Implement view LoanAppEventingToProcAction skeleton class\nImplement `src/main/java/io/kx/loanapp/action/LoanAppEventingToProcAction` class\u003cbr\u003e\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: Check content in `step-4` git branch\n\n## Implement view LoanProcEventingToAppAction skeleton class\nImplement `src/main/java/io/kx/loanproc/action/LoanProcEventingToAppAction` class\u003cbr\u003e\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: Check content in `step-4` git branch\n\n## System integration tests (multiple services)\nIn `src/it/java/io/kx` folder create new class `SystemIntegrationTest`.\n\u003ci\u003e\u003cb\u003eTip\u003c/b\u003e\u003c/i\u003e: Check content in `step-4` git branch\n\n## Run integration test\n```\nmvn verify -Pit\n```\n\n\u003ci\u003e\u003cb\u003eNote\u003c/b\u003e\u003c/i\u003e: Integration tests uses [TestContainers](https://www.testcontainers.org/) to span integration environment so it could require some time to download required containers.\nAlso make sure docker is running.\n\n## Package\n\n```\nmvn package\n```\n\n\u003cbr\u003e\u003cbr\u003e\n\nPush docker image to docker repository:\n```\nmvn docker:push\n```\n## Deploy service\n```\nkalix service deploy loan-application my-docker-repo/loan-application:1.3-SNAPSHOT\n```\n\u003ci\u003e\u003cb\u003eNote\u003c/b\u003e\u003c/i\u003e: Replace `my-docker-repo` with your docker repository\n\n## Test service in production\nSubmit loan application:\n```\ncurl -XPOST -d '{\n  \"client_id\": \"123456\",\n  \"client_monthly_income_cents\": 60000,\n  \"loan_amount_cents\": 20000,\n  \"loan_duration_months\": 12\n}' https://\u003csomehost\u003e.kalix.app/loanapp/2 -H \"Content-Type: application/json\"\n```\nApprove loan processing:\n```\ncurl -XPUT -d '{\n\"reviewer_id\": \"9999\"\n}' https://\u003csomehost\u003e.kalix.app/loanproc/2/approve -H \"Content-Type: application/json\"\n```\nGet loan application :\n```\ncurl -XGET https://\u003csomehost\u003e.kalix.app/loanapp/2 -H \"Content-Type: application/json\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightbend%2Fkalix-ws-loan-application-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightbend%2Fkalix-ws-loan-application-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightbend%2Fkalix-ws-loan-application-java/lists"}