-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from Infosys/sachin-dev
[ES-2012] added tests and improved code
- Loading branch information
Showing
13 changed files
with
192 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 7 additions & 8 deletions
15
captcha-validation-service/src/main/java/io/mosip/captcha/dto/CaptchaRequestDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
package io.mosip.captcha.dto; | ||
|
||
import java.io.Serializable; | ||
|
||
import io.mosip.captcha.util.ErrorConstants; | ||
import lombok.Data; | ||
import jakarta.validation.constraints.NotBlank; | ||
|
||
@Data | ||
public class CaptchaRequestDTO implements Serializable{ | ||
|
||
/** | ||
* | ||
*/ | ||
public class CaptchaRequestDTO { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
|
||
@NotBlank(message = ErrorConstants.INVALID_CAPTCHA_REQUEST) | ||
private String captchaToken; | ||
|
||
private String moduleName; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 11 additions & 17 deletions
28
captcha-validation-service/src/main/java/io/mosip/captcha/exception/CaptchaException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,29 @@ | ||
package io.mosip.captcha.exception; | ||
|
||
import io.mosip.captcha.util.ErrorConstants; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class CaptchaException extends Exception { | ||
|
||
/** | ||
* | ||
*/ | ||
private static final long serialVersionUID = 1L; | ||
|
||
public CaptchaException(String errorCode) { | ||
this.errorCode = errorCode; | ||
this.errorMessage = ErrorConstants.getErrorMessage(errorCode); | ||
} | ||
|
||
public CaptchaException(String errorCode, String errorMessage) { | ||
this.errorCode = errorCode; | ||
this.errorMessage = errorMessage; | ||
|
||
} | ||
|
||
private String errorCode; | ||
|
||
private String errorMessage; | ||
|
||
public String getErrorCode() { | ||
return errorCode; | ||
} | ||
|
||
public void setErrorCode(String errorCode) { | ||
this.errorCode = errorCode; | ||
} | ||
|
||
public String getErrorMessage() { | ||
return errorMessage; | ||
} | ||
|
||
public void setErrorMessage(String errorMessage) { | ||
this.errorMessage = errorMessage; | ||
} | ||
} |
32 changes: 0 additions & 32 deletions
32
...tion-service/src/main/java/io/mosip/captcha/exception/InvalidRequestCaptchaException.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
captcha-validation-service/src/main/java/io/mosip/captcha/spi/CaptchaService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
package io.mosip.captcha.spi; | ||
|
||
import io.mosip.captcha.dto.CaptchaRequestDTO; | ||
import io.mosip.captcha.dto.CaptchaResponseDTO; | ||
import io.mosip.captcha.dto.ResponseWrapper; | ||
import io.mosip.captcha.exception.CaptchaException; | ||
import io.mosip.captcha.exception.InvalidRequestCaptchaException; | ||
|
||
public interface CaptchaService{ | ||
|
||
Object validateCaptcha(Object captchaRequest) throws CaptchaException, InvalidRequestCaptchaException; | ||
ResponseWrapper<CaptchaResponseDTO> validateCaptcha(CaptchaRequestDTO captchaRequest) throws CaptchaException; | ||
|
||
|
||
} |
Oops, something went wrong.