-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
P4ADEV-320-refactoring-accordingly-handbook
- Loading branch information
1 parent
3d10ce2
commit 0d8a60e
Showing
10 changed files
with
63 additions
and
93 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
20 changes: 20 additions & 0 deletions
20
src/main/java/it/gov/pagopa/payhub/auth/exception/ServiceException.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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package it.gov.pagopa.payhub.auth.exception; | ||
|
||
import lombok.Getter; | ||
import openapi.pagopa.payhub.model.AuthErrorDTO; | ||
|
||
@Getter | ||
public class ServiceException extends RuntimeException { | ||
private final AuthErrorDTO.CodeEnum code; | ||
private final boolean printStackTrace; | ||
|
||
public ServiceException(AuthErrorDTO.CodeEnum code, String message) { | ||
this(code, message, false, null); | ||
} | ||
|
||
public ServiceException(AuthErrorDTO.CodeEnum code, String message, boolean printStackTrace, Throwable ex) { | ||
super(message, ex); | ||
this.code = code; | ||
this.printStackTrace = printStackTrace; | ||
} | ||
} |
15 changes: 6 additions & 9 deletions
15
src/main/java/it/gov/pagopa/payhub/auth/exception/custom/InvalidTokenException.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,23 +1,20 @@ | ||
package it.gov.pagopa.payhub.auth.exception.custom; | ||
|
||
import it.gov.pagopa.payhub.auth.exception.ServiceException; | ||
import lombok.Getter; | ||
import openapi.pagopa.payhub.model.AuthErrorDTO; | ||
|
||
@Getter | ||
public class InvalidTokenException extends RuntimeException { | ||
private final String code; | ||
private final boolean printStackTrace; | ||
public class InvalidTokenException extends ServiceException { | ||
public InvalidTokenException(String message) { | ||
this(AuthErrorDTO.CodeEnum.INVALID_TOKEN.getValue(), message); | ||
this(AuthErrorDTO.CodeEnum.INVALID_TOKEN, message); | ||
} | ||
|
||
public InvalidTokenException(String code, String message) { | ||
public InvalidTokenException(AuthErrorDTO.CodeEnum code, String message) { | ||
this(code, message, false, null); | ||
} | ||
|
||
public InvalidTokenException(String code, String message, boolean printStackTrace, Throwable ex) { | ||
super(message, ex); | ||
this.code = code; | ||
this.printStackTrace = printStackTrace; | ||
public InvalidTokenException(AuthErrorDTO.CodeEnum code, String message, boolean printStackTrace, Throwable ex) { | ||
super(code, message, printStackTrace, ex); | ||
} | ||
} |
15 changes: 6 additions & 9 deletions
15
src/main/java/it/gov/pagopa/payhub/auth/exception/custom/TokenExpiredException.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,23 +1,20 @@ | ||
package it.gov.pagopa.payhub.auth.exception.custom; | ||
|
||
import it.gov.pagopa.payhub.auth.exception.ServiceException; | ||
import lombok.Getter; | ||
import openapi.pagopa.payhub.model.AuthErrorDTO; | ||
|
||
@Getter | ||
public class TokenExpiredException extends RuntimeException { | ||
private final String code; | ||
private final boolean printStackTrace; | ||
public class TokenExpiredException extends ServiceException { | ||
public TokenExpiredException(String message) { | ||
this(AuthErrorDTO.CodeEnum.TOKEN_EXPIRED_DATE.getValue(), message); | ||
this(AuthErrorDTO.CodeEnum.TOKEN_EXPIRED_DATE, message); | ||
} | ||
|
||
public TokenExpiredException(String code, String message) { | ||
public TokenExpiredException(AuthErrorDTO.CodeEnum code, String message) { | ||
this(code, message, false, null); | ||
} | ||
|
||
public TokenExpiredException(String code, String message, boolean printStackTrace, Throwable ex) { | ||
super(message, ex); | ||
this.code = code; | ||
this.printStackTrace = printStackTrace; | ||
public TokenExpiredException(AuthErrorDTO.CodeEnum code, String message, boolean printStackTrace, Throwable ex) { | ||
super(code, message, printStackTrace, ex); | ||
} | ||
} |
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
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
27 changes: 0 additions & 27 deletions
27
src/test/java/it/gov/pagopa/payhub/auth/utils/MemoryAppender.java
This file was deleted.
Oops, something went wrong.