-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into ps/dt-1184-sql-retry-fix
- Loading branch information
Showing
5 changed files
with
59 additions
and
5 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
14 changes: 14 additions & 0 deletions
14
...n/java/bio/terra/service/resourcemanagement/exception/BigQueryAclExhaustionException.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,14 @@ | ||
package bio.terra.service.resourcemanagement.exception; | ||
|
||
import bio.terra.common.exception.BadRequestException; | ||
|
||
public class BigQueryAclExhaustionException extends BadRequestException { | ||
// This constructor is required so this can be deserialized using StairwayExceptionSerializer. | ||
public BigQueryAclExhaustionException(String message) { | ||
super(message); | ||
} | ||
|
||
public BigQueryAclExhaustionException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
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,26 @@ | ||
package bio.terra.common; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertThrows; | ||
|
||
import bio.terra.common.category.Unit; | ||
import bio.terra.service.resourcemanagement.exception.BigQueryAclExhaustionException; | ||
import com.google.cloud.bigquery.BigQueryException; | ||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
|
||
@Tag(Unit.TAG) | ||
class AclUtilsTest { | ||
|
||
@Test | ||
void aclUpdateRetry() { | ||
assertThrows( | ||
BigQueryAclExhaustionException.class, | ||
() -> | ||
AclUtils.aclUpdateRetry( | ||
() -> { | ||
throw new BigQueryException( | ||
0, | ||
"Too many authorized entities in this dataset. The maximum number of authorized views, routines, and datasets combined is 2500."); | ||
})); | ||
} | ||
} |
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