forked from avni-bahmni-integration/integration-service
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#89 - fixed query for getting one item from BQ
- Loading branch information
1 parent
797c3ab
commit 158aecd
Showing
7 changed files
with
46 additions
and
28 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
11 changes: 10 additions & 1 deletion
11
lahi/src/main/java/org/avni_integration_service/lahi/config/LahiErrorType.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,6 +1,15 @@ | ||
package org.avni_integration_service.lahi.config; | ||
|
||
import org.avni_integration_service.common.PlatformException; | ||
import org.avni_integration_service.common.UnknownException; | ||
|
||
public enum LahiErrorType { | ||
CommonError, | ||
PlatformError | ||
PlatformError; | ||
|
||
public static LahiErrorType getErrorType(Exception e) { | ||
if (e instanceof PlatformException) return PlatformError; | ||
if (e instanceof UnknownException) return CommonError; | ||
return null; | ||
} | ||
} |
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: 15 additions & 0 deletions
15
lahi/src/test/java/org/avni_integration_service/lahi/config/LahiErrorTypeTest.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,15 @@ | ||
package org.avni_integration_service.lahi.config; | ||
|
||
import org.avni_integration_service.common.PlatformException; | ||
import org.avni_integration_service.common.UnknownException; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
class LahiErrorTypeTest { | ||
@Test | ||
void getErrorType() { | ||
assertEquals(LahiErrorType.PlatformError, LahiErrorType.getErrorType(new PlatformException(""))); | ||
assertEquals(LahiErrorType.CommonError, LahiErrorType.getErrorType(new UnknownException(new NullPointerException()))); | ||
} | ||
} |