Skip to content

armgit / floci

Public Imported from GitHub
0

Light, fluffy, and always free - The AWS Local Emulator alternative

Feature/issue 1130 glue database tags (#1248)

nblomquist92f4ff1ccfdc
diff --git a/compatibility-tests/sdk-test-go/internal/testutil/fixtures.go b/compatibility-tests/sdk-test-go/internal/testutil/fixtures.go
index e309ec9411..9d1a8fbb22 100644
--- a/compatibility-tests/sdk-test-go/internal/testutil/fixtures.go
+++ b/compatibility-tests/sdk-test-go/internal/testutil/fixtures.go
@@ -16,6 +16,7 @@ import (
"github.com/aws/aws-sdk-go-v2/service/pipes"
"github.com/aws/aws-sdk-go-v2/service/cloudwatch"
"github.com/aws/aws-sdk-go-v2/service/dynamodb"
+ "github.com/aws/aws-sdk-go-v2/service/glue"
"github.com/aws/aws-sdk-go-v2/service/iam"
"github.com/aws/aws-sdk-go-v2/service/kinesis"
"github.com/aws/aws-sdk-go-v2/service/kms"
@@ -24,6 +25,7 @@ import (
"github.com/aws/aws-sdk-go-v2/service/rds"
"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/aws/aws-sdk-go-v2/service/secretsmanager"
+ "github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi"
"github.com/aws/aws-sdk-go-v2/service/sns"
"github.com/aws/aws-sdk-go-v2/service/sqs"
"github.com/aws/aws-sdk-go-v2/service/ssm"
@@ -84,6 +86,11 @@ func LambdaClient() *lambda.Client {
return lambda.NewFromConfig(Config())
}
+// GlueClient returns a new Glue client.
+func GlueClient() *glue.Client {
+ return glue.NewFromConfig(Config())
+}
+
// IAMClient returns a new IAM client.
func IAMClient() *iam.Client {
return iam.NewFromConfig(Config())
@@ -114,6 +121,11 @@ func CloudWatchClient() *cloudwatch.Client {
return cloudwatch.NewFromConfig(Config())
}
+// ResourceGroupsTaggingAPIClient returns a new Resource Groups Tagging API client.
+func ResourceGroupsTaggingAPIClient() *resourcegroupstaggingapi.Client {
+ return resourcegroupstaggingapi.NewFromConfig(Config())
+}
+
// ACMClient returns a new ACM client.
func ACMClient() *acm.Client {
return acm.NewFromConfig(Config())
diff --git a/compatibility-tests/sdk-test-go/tests/glue_test.go b/compatibility-tests/sdk-test-go/tests/glue_test.go
new file mode 100644
index 0000000000..01be69d8cb
--- /dev/null
+++ b/compatibility-tests/sdk-test-go/tests/glue_test.go
@@ -0,0 +1,57 @@
+package tests
+
+import (
+ "context"
+ "fmt"
+ "testing"
+ "time"
+
+ "floci-sdk-test-go/internal/testutil"
+
+ "github.com/aws/aws-sdk-go-v2/aws"
+ "github.com/aws/aws-sdk-go-v2/service/glue"
+ gluetypes "github.com/aws/aws-sdk-go-v2/service/glue/types"
+ "github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi"
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+)
+
+func TestGlueCreateDatabaseTagsAreVisibleViaResourceGroupsTaggingAPI(t *testing.T) {
+ ctx := context.Background()
+ glueClient := testutil.GlueClient()
+ taggingClient := testutil.ResourceGroupsTaggingAPIClient()
+ databaseName := fmt.Sprintf("go-glue-db-%d", time.Now().UnixNano())
+ databaseArn := fmt.Sprintf("arn:aws:glue:us-east-1:000000000000:database/%s", databaseName)
+
+ t.Cleanup(func() {
+ _, _ = glueClient.DeleteDatabase(ctx, &glue.DeleteDatabaseInput{Name: aws.String(databaseName)})
+ })
+
+ _, err := glueClient.CreateDatabase(ctx, &glue.CreateDatabaseInput{
+ DatabaseInput: &gluetypes.DatabaseInput{
+ Name: aws.String(databaseName),
+ Description: aws.String("go glue database tags"),
+ },
+ Tags: map[string]string{
+ "Environment": "dev",
+ "Project": "project1",
+ },
+ })
+ require.NoError(t, err)
+
+ response, err := taggingClient.GetResources(ctx, &resourcegroupstaggingapi.GetResourcesInput{
+ ResourceARNList: []string{databaseArn},
+ })
+ require.NoError(t, err)
+ require.Len(t, response.ResourceTagMappingList, 1)
+
+ mapping := response.ResourceTagMappingList[0]
+ assert.Equal(t, databaseArn, aws.ToString(mapping.ResourceARN))
+
+ tags := map[string]string{}
+ for _, tag := range mapping.Tags {
+ tags[aws.ToString(tag.Key)] = aws.ToString(tag.Value)
+ }
+ assert.Equal(t, "dev", tags["Environment"])
+ assert.Equal(t, "project1", tags["Project"])
+}
diff --git a/compatibility-tests/sdk-test-java/pom.xml b/compatibility-tests/sdk-test-java/pom.xml
index da06eddedc..f1c286f96d 100644
--- a/compatibility-tests/sdk-test-java/pom.xml
+++ b/compatibility-tests/sdk-test-java/pom.xml
@@ -122,6 +122,10 @@
<groupId>software.amazon.awssdk</groupId>
<artifactId>glue</artifactId>
</dependency>
+ <dependency>
+ <groupId>software.amazon.awssdk</groupId>
+ <artifactId>resourcegroupstaggingapi</artifactId>
+ </dependency>
<dependency>
<groupId>software.amazon.glue</groupId>
<artifactId>schema-registry-serde</artifactId>
diff --git a/compatibility-tests/sdk-test-java/src/main/java/com/floci/test/TestFixtures.java b/compatibility-tests/sdk-test-java/src/main/java/com/floci/test/TestFixtures.java
index ee0de0478f..a78c4ba553 100644
--- a/compatibility-tests/sdk-test-java/src/main/java/com/floci/test/TestFixtures.java
+++ b/compatibility-tests/sdk-test-java/src/main/java/com/floci/test/TestFixtures.java
@@ -37,6 +37,7 @@ import software.amazon.awssdk.services.kafka.KafkaClient;
import software.amazon.awssdk.services.athena.AthenaClient;
import software.amazon.awssdk.services.glue.GlueClient;
import software.amazon.awssdk.services.firehose.FirehoseClient;
+import software.amazon.awssdk.services.resourcegroupstaggingapi.ResourceGroupsTaggingApiClient;
import software.amazon.awssdk.services.apigateway.ApiGatewayClient;
import software.amazon.awssdk.services.apigatewayv2.ApiGatewayV2Client;
import software.amazon.awssdk.services.elasticache.ElastiCacheClient;
@@ -374,6 +375,14 @@ public final class TestFixtures {
.build();
}
+ public static ResourceGroupsTaggingApiClient resourceGroupsTaggingApiClient() {
+ return ResourceGroupsTaggingApiClient.builder()
+ .endpointOverride(ENDPOINT)
+ .region(REGION)
+ .credentialsProvider(CREDENTIALS)
+ .build();
+ }
+
public static FirehoseClient firehoseClient() {
return FirehoseClient.builder()
.endpointOverride(ENDPOINT)
diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/GlueCatalogTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/GlueCatalogTest.java
index e7c479649c..824d48dbc7 100644
--- a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/GlueCatalogTest.java
+++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/GlueCatalogTest.java
@@ -34,8 +34,10 @@ import software.amazon.awssdk.services.glue.model.UpdateTableRequest;
import software.amazon.awssdk.services.glue.model.UpdateUserDefinedFunctionRequest;
import software.amazon.awssdk.services.glue.model.UserDefinedFunction;
import software.amazon.awssdk.services.glue.model.UserDefinedFunctionInput;
+import software.amazon.awssdk.services.resourcegroupstaggingapi.ResourceGroupsTaggingApiClient;
import java.util.Map;
+import java.util.stream.Collectors;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -48,12 +50,15 @@ class GlueCatalogTest {
private static final String TABLE_NAME = "catalog_table";
private static final String SECOND_TABLE_NAME = "catalog_table_second";
private static final String FUNCTION_NAME = "catalog_function";
+ private static final String DATABASE_TAGGED_NAME = TestFixtures.uniqueName("catalog_tagged_db");
private static GlueClient glue;
+ private static ResourceGroupsTaggingApiClient tagging;
@BeforeAll
static void setup() {
glue = TestFixtures.glueClient();
+ tagging = TestFixtures.resourceGroupsTaggingApiClient();
}
@AfterAll
@@ -82,6 +87,12 @@ class GlueCatalogTest {
.build());
}
catch (Exception ignored) {}
+ try {
+ glue.deleteDatabase(DeleteDatabaseRequest.builder()
+ .name(DATABASE_TAGGED_NAME)
+ .build());
+ }
+ catch (Exception ignored) {}
try {
glue.deleteDatabase(DeleteDatabaseRequest.builder()
.name(BATCH_DELETE_DATABASE_NAME)
@@ -95,6 +106,7 @@ class GlueCatalogTest {
}
catch (Exception ignored) {}
glue.close();
+ tagging.close();
}
@Test
@@ -264,6 +276,27 @@ class GlueCatalogTest {
.build());
}
+ @Test
+ void createDatabaseWithTags_tagsReturnedByResourceGroupsTaggingApi() {
+ glue.createDatabase(CreateDatabaseRequest.builder()
+ .databaseInput(DatabaseInput.builder()
+ .name(DATABASE_TAGGED_NAME)
+ .description("catalog compatibility database with tags")
+ .build())
+ .tags(Map.of("Environment", "dev", "Project", "project1"))
+ .build());
+
+ String databaseArn = "arn:aws:glue:us-east-1:000000000000:database/" + DATABASE_TAGGED_NAME;
+ var response = tagging.getResources(b -> b.resourceARNList(databaseArn));
+
+ assertThat(response.resourceTagMappingList()).singleElement().satisfies(mapping -> {
+ assertThat(mapping.resourceARN()).isEqualTo(databaseArn);
+ assertThat(mapping.tags().stream().collect(Collectors.toMap(t -> t.key(), t -> t.value())))
+ .containsEntry("Environment", "dev")
+ .containsEntry("Project", "project1");
+ });
+ }
+
private static TableInput tableInput(String description) {
return tableInput(TABLE_NAME, description);
}
diff --git a/compatibility-tests/sdk-test-python/conftest.py b/compatibility-tests/sdk-test-python/conftest.py
index e800974efc..072027a379 100644
--- a/compatibility-tests/sdk-test-python/conftest.py
+++ b/compatibility-tests/sdk-test-python/conftest.py
@@ -115,6 +115,18 @@ def cloudwatch_client(aws_config, client_config):
return boto3.client("cloudwatch", config=client_config, **aws_config)
+def glue_client(aws_config, client_config):
+ """Create Glue client."""
+ return boto3.client("glue", config=client_config, **aws_config)
+
+
+def resourcegroupstaggingapi_client(aws_config, client_config):
+ """Create Resource Groups Tagging API client."""
+ return boto3.client("resourcegroupstaggingapi", config=client_config, **aws_config)
+
+
@pytest.fixture
def logs_client(aws_config, client_config):
"""Create CloudWatch Logs client."""
diff --git a/compatibility-tests/sdk-test-python/tests/test_glue.py b/compatibility-tests/sdk-test-python/tests/test_glue.py
new file mode 100644
index 0000000000..a24d4ba041
--- /dev/null
+++ b/compatibility-tests/sdk-test-python/tests/test_glue.py
@@ -0,0 +1,33 @@
+"""Glue integration tests."""
+
+
+def test_create_database_with_tags_visible_via_resource_groups_tagging_api(
+ glue_client, resourcegroupstaggingapi_client, unique_name
+):
+ """Test Glue CreateDatabase tags are discoverable via GetResources."""
+ database_name = f"glue-db-{unique_name}"
+ database_arn = (
+ f"arn:aws:glue:{glue_client.meta.region_name}:000000000000:database/{database_name}"
+ )
+
+ try:
+ glue_client.create_database(
+ DatabaseInput={
+ "Name": database_name,
+ "Description": "python glue database tags",
+ },
+ Tags={"Environment": "dev", "Project": "project1"},
+ )
+
+ response = resourcegroupstaggingapi_client.get_resources(
+ ResourceARNList=[database_arn]
+ )
+
+ mappings = response["ResourceTagMappingList"]
+ assert len(mappings) == 1
+ assert mappings[0]["ResourceARN"] == database_arn
+ tags = {tag["Key"]: tag["Value"] for tag in mappings[0]["Tags"]}
+ assert tags["Environment"] == "dev"
+ assert tags["Project"] == "project1"
+ finally:
+ glue_client.delete_database(Name=database_name)
diff --git a/src/main/java/io/github/hectorvent/floci/services/glue/GlueJsonHandler.java b/src/main/java/io/github/hectorvent/floci/services/glue/GlueJsonHandler.java
index a0a7eb145c..5839f554bb 100644
--- a/src/main/java/io/github/hectorvent/floci/services/glue/GlueJsonHandler.java
+++ b/src/main/java/io/github/hectorvent/floci/services/glue/GlueJsonHandler.java
@@ -47,7 +47,11 @@ public class GlueJsonHandler {
return switch (action) {
case "CreateDatabase" -> {
Database db = mapper.treeToValue(request.get("DatabaseInput"), Database.class);
- glueService.createDatabase(db);
+ @SuppressWarnings("unchecked")
+ Map<String, String> tags = request.has("Tags")
+ ? mapper.convertValue(request.get("Tags"), Map.class)
+ : null;
+ glueService.createDatabase(db, tags, region);
yield Response.ok().build();
}
case "GetDatabase" -> {
@@ -60,7 +64,7 @@ public class GlueJsonHandler {
}
case "DeleteDatabase" -> {
String name = request.get("Name").asText();
- glueService.deleteDatabase(name);
+ glueService.deleteDatabase(name, region);
yield Response.ok().build();
}
case "UpdateDatabase" -> {
diff --git a/src/main/java/io/github/hectorvent/floci/services/glue/GlueService.java b/src/main/java/io/github/hectorvent/floci/services/glue/GlueService.java
index 25606564b5..be927c90f3 100644
--- a/src/main/java/io/github/hectorvent/floci/services/glue/GlueService.java
+++ b/src/main/java/io/github/hectorvent/floci/services/glue/GlueService.java
@@ -17,6 +17,7 @@ import io.github.hectorvent.floci.services.glue.schemaregistry.GlueSchemaRegistr
import io.github.hectorvent.floci.services.glue.schemaregistry.SchemaToColumnsConverter;
import io.github.hectorvent.floci.services.glue.schemaregistry.model.SchemaId;
import io.github.hectorvent.floci.services.glue.schemaregistry.model.SchemaVersion;
+import io.github.hectorvent.floci.services.resourcegroupstagging.ResourceGroupsTaggingService;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import org.jboss.logging.Logger;
@@ -46,11 +47,13 @@ public class GlueService {
private final StorageBackend<String, UserDefinedFunction> functionStore;
private final GlueSchemaRegistryService schemaRegistryService;
private final RegionResolver regionResolver;
+ private final ResourceGroupsTaggingService resourceGroupsTaggingService;
@Inject
public GlueService(StorageFactory storageFactory,
GlueSchemaRegistryService schemaRegistryService,
- RegionResolver regionResolver) {
+ RegionResolver regionResolver,
+ ResourceGroupsTaggingService resourceGroupsTaggingService) {
this.databaseStore = storageFactory.create("glue", "databases.json", new TypeReference<>() {});
this.tableStore = storageFactory.create("glue", "tables.json", new TypeReference<>() {});
this.tableVersionStore = storageFactory.create("glue", "table_versions.json", new TypeReference<>() {});
@@ -58,6 +61,7 @@ public class GlueService {
this.functionStore = storageFactory.create("glue", "functions.json", new TypeReference<>() {});
this.schemaRegistryService = schemaRegistryService;
this.regionResolver = regionResolver;
+ this.resourceGroupsTaggingService = resourceGroupsTaggingService;
}
GlueService(StorageBackend<String, Database> databaseStore,
@@ -66,7 +70,8 @@ public class GlueService {
StorageBackend<String, Partition> partitionStore,
StorageBackend<String, UserDefinedFunction> functionStore,
GlueSchemaRegistryService schemaRegistryService,
- RegionResolver regionResolver) {
+ RegionResolver regionResolver,
+ ResourceGroupsTaggingService resourceGroupsTaggingService) {
this.databaseStore = databaseStore;
this.tableStore = tableStore;
this.tableVersionStore = tableVersionStore;
@@ -74,15 +79,23 @@ public class GlueService {
this.functionStore = functionStore;
this.schemaRegistryService = schemaRegistryService;
this.regionResolver = regionResolver;
+ this.resourceGroupsTaggingService = resourceGroupsTaggingService;
}
public void createDatabase(Database database) {
+ createDatabase(database, null, regionResolver.getDefaultRegion());
+ }
+
+ public void createDatabase(Database database, Map<String, String> tags, String region) {
String databaseName = normalizeName(database.getName());
if (databaseStore.get(databaseName).isPresent()) {
throw new AwsException("AlreadyExistsException", "Database already exists: " + database.getName(), 400);
}
database.setName(databaseName);
databaseStore.put(databaseName, database);
+ if (tags != null && !tags.isEmpty()) {
+ resourceGroupsTaggingService.tagResources(List.of(databaseArn(region, databaseName)), tags, region);
+ }
LOG.infov("Created Glue Database: {0}", database.getName());
}
@@ -112,6 +125,10 @@ public class GlueService {
}
public void deleteDatabase(String name) {
+ deleteDatabase(name, regionResolver.getDefaultRegion());
+ }
+
+ public void deleteDatabase(String name, String region) {
String databaseName = getDatabase(name).getName();
List<String> tableNames = tableStore.scan(k -> true).stream()
.filter(table -> databaseName.equals(table.getDatabaseName()))
@@ -119,6 +136,7 @@ public class GlueService {
.toList();
tableNames.forEach(tableName -> deleteTable(name, tableName));
databaseStore.delete(databaseName);
+ resourceGroupsTaggingService.deleteResources(List.of(databaseArn(region, databaseName)), region);
LOG.infov("Deleted Glue Database: {0}", name);
}
@@ -362,6 +380,10 @@ public class GlueService {
return name.toLowerCase(Locale.ROOT);
}
+ private String databaseArn(String region, String databaseName) {
+ return regionResolver.buildArn("glue", region, "database/" + databaseName);
+ }
+
private static Pattern compileFunctionPattern(String pattern) {
if (pattern == null) {
return Pattern.compile(".*");
diff --git a/src/main/java/io/github/hectorvent/floci/services/resourcegroupstagging/ResourceGroupsTaggingService.java b/src/main/java/io/github/hectorvent/floci/services/resourcegroupstagging/ResourceGroupsTaggingService.java
index 38ad6f4d45..c4f47eb491 100644
--- a/src/main/java/io/github/hectorvent/floci/services/resourcegroupstagging/ResourceGroupsTaggingService.java
+++ b/src/main/java/io/github/hectorvent/floci/services/resourcegroupstagging/ResourceGroupsTaggingService.java
@@ -38,6 +38,12 @@ public class ResourceGroupsTaggingService {
}
}
+ public void deleteResources(List<String> resourceArns, String region) {
+ for (String arn : resourceArns) {
+ store.remove(key(region, arn));
+ }
+ }
+
// ─── GetResources ──────────────────────────────────────────────────────────
public record TagFilter(String key, List<String> values) {}
diff --git a/src/test/java/io/github/hectorvent/floci/services/glue/GlueDatabaseTaggingIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/glue/GlueDatabaseTaggingIntegrationTest.java
new file mode 100644
index 0000000000..cf4f20a246
--- /dev/null
+++ b/src/test/java/io/github/hectorvent/floci/services/glue/GlueDatabaseTaggingIntegrationTest.java
@@ -0,0 +1,104 @@
+package io.github.hectorvent.floci.services.glue;
+
+import io.github.hectorvent.floci.testing.RestAssuredJsonUtils;
+import io.quarkus.test.junit.QuarkusTest;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+
+import java.util.UUID;
+
+import static io.restassured.RestAssured.given;
+import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.hasItems;
+
+@QuarkusTest
+class GlueDatabaseTaggingIntegrationTest {
+
+ private static final String CONTENT_TYPE = "application/x-amz-json-1.1";
+ private static final String DATABASE_NAME = "tagged-db-" + UUID.randomUUID().toString().substring(0, 8);
+ private static final String DATABASE_ARN = "arn:aws:glue:us-east-1:000000000000:database/" + DATABASE_NAME;
+
+ @BeforeAll
+ static void configureRestAssured() {
+ RestAssuredJsonUtils.configureAwsContentTypes();
+ }
+
+ @Test
+ void createDatabaseWithTags_tagsReturnedByResourceGroupsTaggingApi() {
+ given().contentType(CONTENT_TYPE)
+ .header("X-Amz-Target", "AWSGlue.CreateDatabase")
+ .body("""
+ {
+ "DatabaseInput": {
+ "Name": "%s",
+ "Description": "catalog db with tags"
+ },
+ "Tags": {
+ "Environment": "dev",
+ "Project": "project1"
+ }
+ }
+ """.formatted(DATABASE_NAME))
+ .when().post("/")
+ .then().statusCode(200);
+
+ given().contentType(CONTENT_TYPE)
+ .header("X-Amz-Target", "ResourceGroupsTaggingAPI_20170126.GetResources")
+ .body("""
+ {
+ "ResourceARNList": ["%s"]
+ }
+ """.formatted(DATABASE_ARN))
+ .when().post("/")
+ .then()
+ .statusCode(200)
+ .body("ResourceTagMappingList.size()", equalTo(1))
+ .body("ResourceTagMappingList[0].ResourceARN", equalTo(DATABASE_ARN))
+ .body("ResourceTagMappingList[0].Tags.size()", equalTo(2))
+ .body("ResourceTagMappingList[0].Tags.Key", hasItems("Environment", "Project"))
+ .body("ResourceTagMappingList[0].Tags.Value", hasItems("dev", "project1"));
+ }
+
+ @Test
+ void deleteDatabase_removesTagsFromResourceGroupsTaggingApi() {
+ String databaseName = "tagged-db-delete-" + UUID.randomUUID().toString().substring(0, 8);
+ String databaseArn = "arn:aws:glue:us-east-1:000000000000:database/" + databaseName;
+
+ given().contentType(CONTENT_TYPE)
+ .header("X-Amz-Target", "AWSGlue.CreateDatabase")
+ .body("""
+ {
+ "DatabaseInput": {
+ "Name": "%s"
+ },
+ "Tags": {
+ "Environment": "dev"
+ }
+ }
+ """.formatted(databaseName))
+ .when().post("/")
+ .then().statusCode(200);
+
+ given().contentType(CONTENT_TYPE)
+ .header("X-Amz-Target", "AWSGlue.DeleteDatabase")
+ .body("""
+ {
+ "Name": "%s"
+ }
+ """.formatted(databaseName))
+ .when().post("/")
+ .then().statusCode(200);
+
+ given().contentType(CONTENT_TYPE)
+ .header("X-Amz-Target", "ResourceGroupsTaggingAPI_20170126.GetResources")
+ .body("""
+ {
+ "ResourceARNList": ["%s"]
+ }
+ """.formatted(databaseArn))
+ .when().post("/")
+ .then()
+ .statusCode(200)
+ .body("ResourceTagMappingList.size()", equalTo(0));
+ }
+}
diff --git a/src/test/java/io/github/hectorvent/floci/services/glue/GlueServiceTest.java b/src/test/java/io/github/hectorvent/floci/services/glue/GlueServiceTest.java
index 99ca25df30..da0e37f62e 100644
--- a/src/test/java/io/github/hectorvent/floci/services/glue/GlueServiceTest.java
+++ b/src/test/java/io/github/hectorvent/floci/services/glue/GlueServiceTest.java
@@ -16,6 +16,7 @@ import io.github.hectorvent.floci.services.glue.model.UserDefinedFunction;
import io.github.hectorvent.floci.services.glue.schemaregistry.GlueSchemaRegistryService;
import io.github.hectorvent.floci.services.glue.schemaregistry.model.RegistryId;
import io.github.hectorvent.floci.services.glue.schemaregistry.model.SchemaId;
+import io.github.hectorvent.floci.services.resourcegroupstagging.ResourceGroupsTaggingService;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -63,7 +64,7 @@ class GlueServiceTest {
tableVersionStore,
partitionStore,
new InMemoryStorage<String, UserDefinedFunction>(),
- schemaRegistryService, regionResolver);
+ schemaRegistryService, regionResolver, new ResourceGroupsTaggingService());
glueService.createDatabase(new Database("db1"));
}
diff --git a/src/test/java/io/github/hectorvent/floci/services/resourcegroupstagging/ResourceGroupsTaggingIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/resourcegroupstagging/ResourceGroupsTaggingIntegrationTest.java
index 962932870b..f28b5d8d15 100644
--- a/src/test/java/io/github/hectorvent/floci/services/resourcegroupstagging/ResourceGroupsTaggingIntegrationTest.java
+++ b/src/test/java/io/github/hectorvent/floci/services/resourcegroupstagging/ResourceGroupsTaggingIntegrationTest.java
@@ -84,7 +84,7 @@ class ResourceGroupsTaggingIntegrationTest {
.post("/")
.then()
.statusCode(200)
- .body("ResourceTagMappingList.size()", equalTo(3))
+ .body("ResourceTagMappingList.size()", greaterThanOrEqualTo(3))
.body("ResourceTagMappingList.ResourceARN", hasItems(ARN_INSTANCE, ARN_BUCKET, ARN_FUNCTION));
}