diff --git a/pre-registration-booking-service/pom.xml b/pre-registration-booking-service/pom.xml index 5cb75887f1a..607c5f0c699 100644 --- a/pre-registration-booking-service/pom.xml +++ b/pre-registration-booking-service/pom.xml @@ -49,6 +49,7 @@ 1.2.1-java21-SNAPSHOT 1.2.1-java21-SNAPSHOT 1.2.1-java21-SNAPSHOT + 21 3.2.3 2.0.9.RELEASE @@ -102,6 +103,11 @@ 3.7.0.1746 3.2.0 + + 4.12 + 1.1.6 + 1.7.19 + @@ -187,17 +193,14 @@ net.logstash.logback logstash-logback-encoder - 4.9 ch.qos.logback logback-classic - 1.2.3 ch.qos.logback logback-core - 1.2.3 net.minidev @@ -207,12 +210,10 @@ com.jayway.jsonpath json-path - 2.2.0 net.minidev json-smart - 2.2.1 io.micrometer diff --git a/pre-registration-booking-service/src/main/java/io/mosip/preregistration/booking/BookingApplication.java b/pre-registration-booking-service/src/main/java/io/mosip/preregistration/booking/BookingApplication.java index 18db046d951..e49b4d0ed50 100644 --- a/pre-registration-booking-service/src/main/java/io/mosip/preregistration/booking/BookingApplication.java +++ b/pre-registration-booking-service/src/main/java/io/mosip/preregistration/booking/BookingApplication.java @@ -6,9 +6,12 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.FilterType; +import io.mosip.preregistration.booking.config.BookingConfig; + /** * This class is used to define the start of the Booking application. * @@ -33,6 +36,7 @@ "io\\.mosip\\.kernel\\.crypto\\..*", "io\\.mosip\\.kernel\\.clientcrypto\\..*", }) }) +@EnableConfigurationProperties(BookingConfig.class) public class BookingApplication { /** * Method to start the Booking API service diff --git a/pre-registration-booking-service/src/main/java/io/mosip/preregistration/booking/config/BookingConfig.java b/pre-registration-booking-service/src/main/java/io/mosip/preregistration/booking/config/BookingConfig.java index e3529399005..1c667cdc540 100644 --- a/pre-registration-booking-service/src/main/java/io/mosip/preregistration/booking/config/BookingConfig.java +++ b/pre-registration-booking-service/src/main/java/io/mosip/preregistration/booking/config/BookingConfig.java @@ -5,24 +5,25 @@ */ package io.mosip.preregistration.booking.config; -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.servers.Server; +import java.util.Collections; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springdoc.core.GroupedOpenApi; +import org.springdoc.core.models.GroupedOpenApi; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import java.util.Collections; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.servers.Server; /** diff --git a/pre-registration-booking-service/src/main/java/io/mosip/preregistration/booking/controller/BookingController.java b/pre-registration-booking-service/src/main/java/io/mosip/preregistration/booking/controller/BookingController.java index 9f63d7ab338..3d196011046 100644 --- a/pre-registration-booking-service/src/main/java/io/mosip/preregistration/booking/controller/BookingController.java +++ b/pre-registration-booking-service/src/main/java/io/mosip/preregistration/booking/controller/BookingController.java @@ -43,12 +43,12 @@ import io.mosip.preregistration.core.util.DataValidationUtil; import io.mosip.preregistration.core.util.RequestValidator; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.tags.Tag; -import springfox.documentation.annotations.ApiIgnore; /** * This class provides different API's to perform operations on Booking @@ -131,7 +131,7 @@ public ResponseEntity> getAvailability( @ApiResponse(responseCode = "404", description = "Not Found", content = @Content(schema = @Schema(hidden = true))) }) public ResponseEntity> bookAppoinment( @PathVariable("preRegistrationId") String preRegistrationId, - @Validated @RequestBody(required = true) MainRequestDTO bookingDTO, @ApiIgnore Errors errors ) { + @Validated @RequestBody(required = true) MainRequestDTO bookingDTO, @Parameter(hidden = true) Errors errors ) { log.info("sessionId", "idType", "id", "In bookAppoinment method of Booking controller to book an appointment for object: " + bookingDTO); requestValidator.validateId(BOOKING, bookingDTO.getId(), errors); @@ -157,7 +157,7 @@ public ResponseEntity> bookAppoinment( @ApiResponse(responseCode = "403", description = "Forbidden", content = @Content(schema = @Schema(hidden = true))), @ApiResponse(responseCode = "404", description = "Not Found", content = @Content(schema = @Schema(hidden = true))) }) public ResponseEntity> bookMultiAppoinment( - @Validated @RequestBody(required = true) MainRequestDTO bookingRequest, @ApiIgnore Errors errors) { + @Validated @RequestBody(required = true) MainRequestDTO bookingRequest, @Parameter(hidden = true) Errors errors) { log.info("sessionId", "idType", "id", "In bookAppoinment method of Booking controller to book an appointment for object: " + bookingRequest); requestValidator.validateId(BOOKING, bookingRequest.getId(), errors); diff --git a/pre-registration-booking-service/src/main/java/io/mosip/preregistration/booking/exception/util/BookingExceptionHandler.java b/pre-registration-booking-service/src/main/java/io/mosip/preregistration/booking/exception/util/BookingExceptionHandler.java index 32cb4f48226..3cca3095bd8 100644 --- a/pre-registration-booking-service/src/main/java/io/mosip/preregistration/booking/exception/util/BookingExceptionHandler.java +++ b/pre-registration-booking-service/src/main/java/io/mosip/preregistration/booking/exception/util/BookingExceptionHandler.java @@ -457,7 +457,7 @@ public ResponseEntity> authServiceException(final Notificatio List errorList = new ArrayList<>(); e.getValidationErrorList().stream().forEach(serviceError -> errorList .add(new ExceptionJSONInfoDTO(serviceError.getErrorCode(), serviceError.getMessage()))); - MainResponseDTO errorRes = e.getMainResposneDTO(); + MainResponseDTO errorRes = e.getMainResponseDTO(); errorRes.setErrors(errorList); errorRes.setResponsetime(GenericUtil.getCurrentResponseTime()); return new ResponseEntity<>(errorRes, HttpStatus.OK); diff --git a/pre-registration-booking-service/src/test/java/io/mosip/preregistration/booking/test/service/util/BookingServiceUtilTest.java b/pre-registration-booking-service/src/test/java/io/mosip/preregistration/booking/test/service/util/BookingServiceUtilTest.java index 919ee8974cf..caa2dfe867b 100644 --- a/pre-registration-booking-service/src/test/java/io/mosip/preregistration/booking/test/service/util/BookingServiceUtilTest.java +++ b/pre-registration-booking-service/src/test/java/io/mosip/preregistration/booking/test/service/util/BookingServiceUtilTest.java @@ -51,15 +51,12 @@ import io.mosip.preregistration.booking.dto.RegistrationCenterResponseDto; import io.mosip.preregistration.booking.dto.SlotDto; import io.mosip.preregistration.booking.entity.AvailibityEntity; -import io.mosip.preregistration.booking.errorcodes.ErrorCodes; -import io.mosip.preregistration.booking.errorcodes.ErrorMessages; import io.mosip.preregistration.booking.exception.AppointmentReBookingFailedException; import io.mosip.preregistration.booking.exception.AvailablityNotFoundException; import io.mosip.preregistration.booking.exception.BookingDateNotSeletectedException; import io.mosip.preregistration.booking.exception.BookingPreIdNotFoundException; import io.mosip.preregistration.booking.exception.BookingRegistrationCenterIdNotFoundException; import io.mosip.preregistration.booking.exception.BookingTimeSlotNotSeletectedException; -import io.mosip.preregistration.booking.exception.DemographicGetStatusException; import io.mosip.preregistration.booking.exception.InvalidDateTimeFormatException; import io.mosip.preregistration.booking.exception.RecordNotFoundException; import io.mosip.preregistration.booking.exception.TimeSpanException; @@ -68,18 +65,15 @@ import io.mosip.preregistration.booking.repository.impl.BookingDAO; import io.mosip.preregistration.booking.service.util.BookingServiceUtil; import io.mosip.preregistration.core.common.dto.BookingRegistrationDTO; -import io.mosip.preregistration.core.common.dto.ExceptionJSONInfoDTO; import io.mosip.preregistration.core.common.dto.MainRequestDTO; -import io.mosip.preregistration.core.common.dto.MainResponseDTO; import io.mosip.preregistration.core.common.dto.NotificationDTO; -import io.mosip.preregistration.core.common.dto.PreRegistartionStatusDTO; import io.mosip.preregistration.core.common.dto.ResponseWrapper; import io.mosip.preregistration.core.exception.MasterDataNotAvailableException; import io.mosip.preregistration.core.exception.RestCallException; import io.mosip.preregistration.core.util.RequestValidator; @RunWith(SpringRunner.class) -@SpringBootTest +@SpringBootTest(classes = { BookingServiceUtil.class }) public class BookingServiceUtilTest { @MockBean diff --git a/pre-registration-booking-service/src/test/resources/application.properties b/pre-registration-booking-service/src/test/resources/application.properties index c29b2053e86..7ee77ec9261 100644 --- a/pre-registration-booking-service/src/test/resources/application.properties +++ b/pre-registration-booking-service/src/test/resources/application.properties @@ -1,7 +1,10 @@ -javax.persistence.jdbc.driver=org.h2.Driver -javax.persistence.jdbc.url=jdbc:h2\:mem\:testdb;DB_CLOSE_DELAY=-1;INIT=RUNSCRIPT FROM 'classpath:create-schema.sql' -javax.persistence.jdbc.user=sa -javax.persistence.jdbc.password= +# javax.persistence.jdbc.driver=org.h2.Driver +# javax.persistence.jdbc.url=jdbc:h2\:mem\:testdb;DB_CLOSE_DELAY=-1;INIT=RUNSCRIPT FROM 'classpath:create-schema.sql' +# javax.persistence.jdbc.user=sa +javax.persistence.jdbc.driver: org.postgresql.Driver +javax.persistence.jdbc.url=jdbc:postgresql://api-internal.dev1.mosip.net:5432/mosip_prereg +javax.persistence.jdbc.user: postgres +javax.persistence.jdbc.password=aRWP1G52uu mosip.kernel.objectstore.account-name=prereg cancel.appoinment.template=cancel-appointment hibernate.hbm2ddl.auto=update @@ -13,10 +16,10 @@ hibernate.cache.use_second_level_cache=false hibernate.cache.use_query_cache=false hibernate.cache.use_structured_entries=false hibernate.generate_statistics=false -notification.url=https://dev.mosip.net/notification/notify +notification.url=https://api-internal.dev1.mosip.net/notification/notify mosip.supported-languages=eng,ara,fra mosip.primary-language=eng -mosip.io.prid.url=https://dev.mosip.net/v1/pridgenerator/prid +mosip.io.prid.url=https://api-internal.dev1.mosip.net/v1/pridgenerator/prid # preregistration.country.specific.zoneId=GMT+05:30 booking.resource.url=${dev.dns.url}/preregistration/v1 preregistration.rebook.timespan = 24 @@ -103,8 +106,8 @@ mosip.preregistration.booking.availability.increase.id=mosip.preregistration.boo mosip.preregistration.booking.availability.check.id=mosip.preregistration.booking.availability.check mosip.preregistration.booking.delete.old.id=mosip.preregistration.booking.delete.old mosip.preregistration.booking.exception.id=mosip.preregistration.booking.parse.exception -mosip.kernel.idobjectvalidator.masterdata.documenttypes.rest.uri=https://dev.mosip.net/v1/masterdata/documenttypes/{documentcategorycode}/{langcode} -mosip.kernel.masterdata.validdoc.rest.uri==https://dev.mosip.net/masterdata/validdocuments/ +mosip.kernel.idobjectvalidator.masterdata.documenttypes.rest.uri=https://api-internal.dev1.mosip.net/v1/masterdata/documenttypes/{documentcategorycode}/{langcode} +mosip.kernel.masterdata.validdoc.rest.uri==https://api-internal.dev1.mosip.net/masterdata/validdocuments/ mosip.preregistration.booking.id.book=mosip.preregistration.booking.book # Name node url for HDFS @@ -142,7 +145,7 @@ mosip.kernel.prid.restricted-numbers=786,666 mosip.kernel.virus-scanner.host=104.211.200.46 mosip.kernel.virus-scanner.port=3310 -mosip.batch.token.authmanager.url= https://dev.mosip.net/v1/authmanager/authenticate/useridPwd +mosip.batch.token.authmanager.url= https://api-internal.dev1.mosip.net/v1/authmanager/authenticate/useridPwd mosip.batch.token.authmanager.appId=ida mosip.batch.token.authmanager.userName=110005 mosip.batch.token.authmanager.password=mosip @@ -164,9 +167,10 @@ mosip.security.authentication.provider.beans.list=customJWTAuthProvider mosip.kernel.auth.appids.realm.map={prereg:'preregistration',ida:'mosip',registrationclient:'mosip',regproc:'mosip',partner:'mosip',resident:'mosip',admin:'mosip',crereq:'mosip',creser:'mosip',datsha:'mosip'} # To generate token from keycloak. Use by kernel auth adapter. mosip.iam.adapter.clientid=mosip-prereg-client -mosip.iam.adapter.clientsecret=abc123 +mosip.iam.adapter.clientsecret=lJmGIMqcfgsZiHh9 mosip.iam.adapter.appid=prereg # URL to get new Auth Token from OIDC provider & to do online validation of auth token with OIDC provider. -auth.server.admin.issuer.uri=https://dev.mosip.net/keycloak/auth/realms/ +# auth.server.admin.issuer.uri=https://api-internal.dev1.mosip.net/keycloak/auth/realms/ +auth.server.admin.issuer.uri=https://iam.dev1.mosip.net/auth/realms/ spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER \ No newline at end of file