File tree Expand file tree Collapse file tree
main/java/org/folio/edge/api/utils
test/java/org/folio/edge/api/utils/exception Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626 <maven-source-plugin .version>3.4.0</maven-source-plugin .version>
2727 <build-helper-maven-plugin .version>3.6.1</build-helper-maven-plugin .version>
2828 <maven-release-plugin .version>3.3.1</maven-release-plugin .version>
29- <awaitility .version>4.3.0</awaitility .version>
30- <junit .version>4.13.2</junit .version>
3129 <wiremock .version>3.13.2</wiremock .version>
32- <mockito .version>5.21.0</mockito .version>
3330 <folio-spring-base .version>10.0.0</folio-spring-base .version>
3431 <folio-tls-utils .version>4.0.0</folio-tls-utils .version>
3532 </properties >
9895 <dependency >
9996 <groupId >org.awaitility</groupId >
10097 <artifactId >awaitility</artifactId >
101- <version >${awaitility.version} </version >
10298 <scope >test</scope >
10399 </dependency >
104100 <dependency >
105101 <groupId >org.mockito</groupId >
106102 <artifactId >mockito-core</artifactId >
107- <version >${mockito.version} </version >
103+ <scope >test</scope >
104+ </dependency >
105+ <dependency >
106+ <groupId >org.junit.jupiter</groupId >
107+ <artifactId >junit-jupiter-api</artifactId >
108108 <scope >test</scope >
109109 </dependency >
110110 <dependency >
111111 <groupId >junit</groupId >
112112 <artifactId >junit</artifactId >
113- <version >${junit.version} </version >
113+ <scope >test</scope >
114+ </dependency >
115+ <dependency >
116+ <groupId >org.junit.vintage</groupId >
117+ <artifactId >junit-vintage-engine</artifactId >
114118 <scope >test</scope >
115119 </dependency >
116120 <dependency >
Original file line number Diff line number Diff line change 11package org .folio .edge .api .utils .exception ;
22
33/**
4- * Specific exception for handlig edge-authorization process
4+ * Specific exception for handling edge-authorization process
55 */
66public class AuthorizationException extends RuntimeException {
77
88 public AuthorizationException (String message ) {
99 super (message );
1010 }
11+
12+ public AuthorizationException (String message , Throwable cause ) {
13+ super (message , cause );
14+ }
1115}
1216
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public static Properties getProperties(String secureStorePropFile) {
3636 logger .info ("Successfully loaded properties from: {}" , secureStorePropFile );
3737 }
3838 } catch (Exception e ) {
39- throw new AuthorizationException ("Failed to load secure store properties" );
39+ throw new AuthorizationException ("Failed to load secure store properties" , e );
4040 }
4141 } else {
4242 logger .warn ("No secure store properties file specified. Using defaults" );
Original file line number Diff line number Diff line change 1+ package org .folio .edge .api .utils .exception ;
2+
3+ import static org .hamcrest .MatcherAssert .assertThat ;
4+ import static org .hamcrest .Matchers .theInstance ;
5+ import static org .hamcrest .Matchers .is ;
6+
7+ import org .junit .jupiter .api .Test ;
8+
9+ class AuthorizationExceptionTest {
10+
11+ @ Test
12+ void message () {
13+ var e = new AuthorizationException ("hi" );
14+ assertThat (e .getMessage (), is ("hi" ));
15+ }
16+
17+ @ Test
18+ void messageAndCause () {
19+ var cause = new IllegalArgumentException ("bar" );
20+ var e = new AuthorizationException ("foo" , cause );
21+ assertThat (e .getMessage (), is ("foo" ));
22+ assertThat (e .getCause (), is (theInstance (cause )));
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments