Skip to content

Commit

Permalink
fixed make tests failing
Browse files Browse the repository at this point in the history
  • Loading branch information
holashchand committed Sep 7, 2023
1 parent 17c824a commit 920da2d
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ java/registry/target/registry.jar: $(SOURCES)
cd java && ./mvnw clean install

test: build
@echo "VIEW_DIR=java/apitest/src/test/resources/views" >> .env || echo "no permission to append to file"
@echo "SCHEMA_DIR=java/apitest/src/test/resources/schemas" >> .env || echo "no permission to append to file"
@docker-compose down
@rm -rf db-data* || echo "no permission to delete"
# test with distributed definition manager and native search
@SEARCH_PROVIDER_NAME=dev.sunbirdrc.registry.service.NativeSearchService RELEASE_VERSION=latest KEYCLOAK_IMPORT_DIR=java/apitest/src/test/resources KEYCLOAK_SECRET=a52c5f4a-89fd-40b9-aea2-3f711f14c889 MANAGER_TYPE=DistributedDefinitionsManager DB_DIR=db-data-1 docker-compose up -d db keycloak registry certificate-signer certificate-api redis
@docker-compose --env-file test_environments/test1.env up -d db keycloak registry certificate-signer certificate-api redis
@echo "Starting the test" && sh build/wait_for_port.sh 8080
@echo "Starting the test" && sh build/wait_for_port.sh 8081
@docker-compose ps
Expand All @@ -42,7 +40,7 @@ test: build
@docker-compose down
@rm -rf db-data-1 || echo "no permission to delete"
# test with kafka(async), events, notifications,
@NOTIFICATION_ENABLED=true NOTIFICATION_URL=http://notification-ms:8765/notification-service/v1/notification TRACK_NOTIFICATIONS=true EVENT_ENABLED=true ASYNC_ENABLED=true RELEASE_VERSION=latest KEYCLOAK_IMPORT_DIR=java/apitest/src/test/resources KEYCLOAK_SECRET=a52c5f4a-89fd-40b9-aea2-3f711f14c889 DB_DIR=db-data-2 docker-compose up -d db clickhouse redis es keycloak registry certificate-signer certificate-api kafka zookeeper notification-ms metrics
@docker-compose --env-file test_environments/test2.env up -d db clickhouse redis es keycloak registry certificate-signer certificate-api kafka zookeeper notification-ms metrics
@echo "Starting the test" && sh build/wait_for_port.sh 8080
@echo "Starting the test" && sh build/wait_for_port.sh 8081
@docker-compose ps
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ services:
- sunbird_sso_admin_client_id=${KEYCLOAK_ADMIN_CLIENT_ID-admin-api}
- sunbird_sso_client_id=${KEYCLOAK_CLIENT_ID-registry-frontend}
- sunbird_sso_admin_client_secret=${KEYCLOAK_SECRET}
- claims_enabled=false
- claims_enabled=${CLAIMS_ENABLED-false}
- claims_url=http://claim-ms:8082
- signature_enabled=false
- signature_enabled=${SIGNATURE_ENABLED-false}
- sign_url=http://certificate-signer:8079/sign
- verify_url=http://certificate-signer:8079/verify
- sign_health_check_url=http://certificate-signer:8079/health
- certificate_enabled=false
- certificate_enabled=${CERTIFICATE_ENABLED-false}
- pdf_url=http://certificate-api:8078/api/v1/certificatePDF
- certificate_health_check_url=http://certificate-api:8078/health
- template_base_url=http://registry:8081/api/v1/templates/ #Looks for certificate templates for pdf copy of the signed certificate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Component;

import javax.validation.constraints.NotEmpty;
Expand Down Expand Up @@ -48,7 +49,7 @@ public class EntityStateHelper {

@Autowired
public EntityStateHelper(IDefinitionsManager definitionsManager, RuleEngineService ruleEngineService,
ConditionResolverService conditionResolverService, ClaimRequestClient claimRequestClient) {
ConditionResolverService conditionResolverService,@Nullable ClaimRequestClient claimRequestClient) {
this.definitionsManager = definitionsManager;
this.ruleEngineService = ruleEngineService;
this.conditionResolverService = conditionResolverService;
Expand Down
11 changes: 11 additions & 0 deletions test_environments/test1.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# test with distributed definition manager and native search
VIEW_DIR=java/apitest/src/test/resources/views
SCHEMA_DIR=java/apitest/src/test/resources/schemas
SIGNATURE_ENABLED=true
CERTIFICATE_ENABLED=true
RELEASE_VERSION=latest
SEARCH_PROVIDER_NAME=dev.sunbirdrc.registry.service.NativeSearchService
KEYCLOAK_IMPORT_DIR=java/apitest/src/test/resources
KEYCLOAK_SECRET=a52c5f4a-89fd-40b9-aea2-3f711f14c889
MANAGER_TYPE=DistributedDefinitionsManager
DB_DIR=db-data-1
14 changes: 14 additions & 0 deletions test_environments/test2.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# test with kafka(async), events, notifications
VIEW_DIR=java/apitest/src/test/resources/views
SCHEMA_DIR=java/apitest/src/test/resources/schemas
SIGNATURE_ENABLED=true
CERTIFICATE_ENABLED=true
NOTIFICATION_ENABLED=true
TRACK_NOTIFICATIONS=true
EVENT_ENABLED=true
ASYNC_ENABLED=true
RELEASE_VERSION=latest
NOTIFICATION_URL=http://notification-ms:8765/notification-service/v1/notification
KEYCLOAK_IMPORT_DIR=java/apitest/src/test/resources
KEYCLOAK_SECRET=a52c5f4a-89fd-40b9-aea2-3f711f14c889
DB_DIR=db-data-2

0 comments on commit 920da2d

Please sign in to comment.