mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
chore: import fully qualified types, lifecycle to verifiedpermissions (#6739)
This commit is contained in:
1 parent
1f9b3993e2
commit
2eaf268727
10 files changed
+65
-53
No files matched your search
@@ -7,6 +7,7 @@ import io.github.hectorvent.floci.core.storage.PersistentPathValidator;
|
||||
import io.github.hectorvent.floci.core.storage.StorageFactory;
|
||||
import io.github.hectorvent.floci.lifecycle.inithook.InitializationHook;
|
||||
import io.github.hectorvent.floci.lifecycle.inithook.InitializationHooksRunner;
|
||||
import io.github.hectorvent.floci.services.amazonmq.container.RabbitMqManager;
|
||||
import io.github.hectorvent.floci.services.appsync.graphql.SchemaCreationWorker;
|
||||
import io.github.hectorvent.floci.services.docdb.container.DocDbContainerManager;
|
||||
import io.github.hectorvent.floci.services.dynamodb.DynamoDbRuntime;
|
||||
@@ -20,12 +21,17 @@ import io.github.hectorvent.floci.services.elasticache.ElastiCacheService;
|
||||
import io.github.hectorvent.floci.services.elasticache.container.ElastiCacheContainerManager;
|
||||
import io.github.hectorvent.floci.services.elasticache.container.ElastiCacheMemcachedContainerManager;
|
||||
import io.github.hectorvent.floci.services.elasticache.proxy.ElastiCacheProxyManager;
|
||||
import io.github.hectorvent.floci.services.elb.ElbClassicService;
|
||||
import io.github.hectorvent.floci.services.elbv2.ElbV2Service;
|
||||
import io.github.hectorvent.floci.services.floci.ui.FlociUiManager;
|
||||
import io.github.hectorvent.floci.services.iam.IamService;
|
||||
import io.github.hectorvent.floci.services.kinesisanalytics.container.FlinkContainerManager;
|
||||
import io.github.hectorvent.floci.services.lambda.DynamoDbStreamsEventSourcePoller;
|
||||
import io.github.hectorvent.floci.services.lambda.KinesisEventSourcePoller;
|
||||
import io.github.hectorvent.floci.services.lambda.SqsEventSourcePoller;
|
||||
import io.github.hectorvent.floci.services.lambda.durable.DurableExecutionService;
|
||||
import io.github.hectorvent.floci.services.memorydb.container.MemoryDbContainerManager;
|
||||
import io.github.hectorvent.floci.services.memorydb.proxy.MemoryDbProxyManager;
|
||||
import io.github.hectorvent.floci.services.neptune.container.NeptuneContainerManager;
|
||||
import io.github.hectorvent.floci.services.neptune.proxy.NeptuneProxyManager;
|
||||
import io.github.hectorvent.floci.services.pipes.PipesService;
|
||||
@@ -55,9 +61,13 @@ import org.mockito.junit.jupiter.MockitoExtension;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.logging.Handler;
|
||||
import java.util.logging.LogRecord;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
@@ -92,18 +102,18 @@ class EmulatorLifecycleTest {
|
||||
@Mock private ElastiCacheProxyManager elastiCacheProxyManager;
|
||||
@Mock private RdsContainerManager rdsContainerManager;
|
||||
@Mock private RdsProxyManager rdsProxyManager;
|
||||
@Mock private io.github.hectorvent.floci.services.memorydb.container.MemoryDbContainerManager memoryDbContainerManager;
|
||||
@Mock private io.github.hectorvent.floci.services.memorydb.proxy.MemoryDbProxyManager memoryDbProxyManager;
|
||||
@Mock private MemoryDbContainerManager memoryDbContainerManager;
|
||||
@Mock private MemoryDbProxyManager memoryDbProxyManager;
|
||||
@Mock private DocDbContainerManager docDbContainerManager;
|
||||
@Mock private NeptuneContainerManager neptuneContainerManager;
|
||||
@Mock private NeptuneProxyManager neptuneProxyManager;
|
||||
@Mock private io.github.hectorvent.floci.services.amazonmq.container.RabbitMqManager rabbitMqManager;
|
||||
@Mock private io.github.hectorvent.floci.services.kinesisanalytics.container.FlinkContainerManager flinkContainerManager;
|
||||
@Mock private RabbitMqManager rabbitMqManager;
|
||||
@Mock private FlinkContainerManager flinkContainerManager;
|
||||
@Mock private RdsService rdsService;
|
||||
@Mock private TimestreamInfluxDbService timestreamInfluxDbService;
|
||||
@Mock private EmulatorConfig.TimestreamInfluxDbServiceConfig timestreamInfluxDbServiceConfig;
|
||||
@Mock private io.github.hectorvent.floci.services.elbv2.ElbV2Service elbV2Service;
|
||||
@Mock private io.github.hectorvent.floci.services.elb.ElbClassicService elbClassicService;
|
||||
@Mock private ElbV2Service elbV2Service;
|
||||
@Mock private ElbClassicService elbClassicService;
|
||||
@Mock private EcsService ecsService;
|
||||
@Mock private EksService eksService;
|
||||
@Mock private InitializationHooksRunner initializationHooksRunner;
|
||||
@@ -170,7 +180,7 @@ class EmulatorLifecycleTest {
|
||||
persistentPathValidator,
|
||||
dynamoDbRuntime, redshiftZeroEtlConsumer, eksService);
|
||||
Mockito.lenient().when(containerTeardowns.iterator())
|
||||
.thenReturn(java.util.Collections.emptyIterator());
|
||||
.thenReturn(Collections.emptyIterator());
|
||||
}
|
||||
|
||||
private void stubStorageConfig() {
|
||||
@@ -754,12 +764,11 @@ class EmulatorLifecycleTest {
|
||||
|
||||
/** Collects the messages EmulatorLifecycle logs while {@code action} runs. */
|
||||
private List<String> lifecycleLogMessages(Runnable action) {
|
||||
java.util.logging.Logger logger =
|
||||
java.util.logging.Logger.getLogger(EmulatorLifecycle.class.getName());
|
||||
Logger logger = Logger.getLogger(EmulatorLifecycle.class.getName());
|
||||
List<String> messages = new CopyOnWriteArrayList<>();
|
||||
java.util.logging.Handler handler = new java.util.logging.Handler() {
|
||||
Handler handler = new Handler() {
|
||||
@Override
|
||||
public void publish(java.util.logging.LogRecord logRecord) {
|
||||
public void publish(LogRecord logRecord) {
|
||||
Object[] parameters = logRecord.getParameters();
|
||||
messages.add(parameters == null || parameters.length == 0
|
||||
? logRecord.getMessage()
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
package io.github.hectorvent.floci.services.lakeformation;
|
||||
|
||||
import io.github.hectorvent.floci.core.common.AwsException;
|
||||
import io.github.hectorvent.floci.core.storage.AccountAwareStorageBackend;
|
||||
import io.github.hectorvent.floci.core.storage.StorageFactory;
|
||||
import io.github.hectorvent.floci.services.lakeformation.model.ResourceInfo;
|
||||
@@ -63,7 +64,7 @@ class LakeFormationResourceRaceTest {
|
||||
await(start);
|
||||
try {
|
||||
storage.updateResource(REGION, RESOURCE_ARN, UPDATE_ROLE, null, null, null);
|
||||
} catch (io.github.hectorvent.floci.core.common.AwsException expected) {
|
||||
} catch (AwsException expected) {
|
||||
if (!"EntityNotFoundException".equals(expected.getErrorCode())) {
|
||||
unexpected.set(expected);
|
||||
}
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
package io.github.hectorvent.floci.services.resourceexplorer2;
|
||||
|
||||
import io.github.hectorvent.floci.core.common.AwsException;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Base64;
|
||||
@@ -65,13 +66,13 @@ class ResourceExplorer2PaginationTest {
|
||||
|
||||
@Test
|
||||
void garbageTokenIsRejected() {
|
||||
assertThrows(io.github.hectorvent.floci.core.common.AwsException.class,
|
||||
assertThrows(AwsException.class,
|
||||
() -> ResourceExplorer2Service.pageBounds(50, 10, "!!!not-base64!!!", CAP));
|
||||
}
|
||||
|
||||
@Test
|
||||
void negativeTokenOffsetIsRejected() {
|
||||
assertThrows(io.github.hectorvent.floci.core.common.AwsException.class,
|
||||
assertThrows(AwsException.class,
|
||||
() -> ResourceExplorer2Service.pageBounds(50, 10, token(-1), CAP));
|
||||
}
|
||||
|
||||
|
||||
@@ -604,8 +604,8 @@ class SnsServiceTest {
|
||||
void publish_messagePlusAttributesExceedsLimit_throwsInvalidParameter() {
|
||||
Topic topic = snsService.createTopic("size-topic", null, null, REGION);
|
||||
String body = "x".repeat(262_100);
|
||||
Map<String, io.github.hectorvent.floci.services.sqs.model.MessageAttributeValue> attrs = Map.of(
|
||||
"longAttribute", new io.github.hectorvent.floci.services.sqs.model.MessageAttributeValue(
|
||||
Map<String, MessageAttributeValue> attrs = Map.of(
|
||||
"longAttribute", new MessageAttributeValue(
|
||||
"y".repeat(200), "String"));
|
||||
AwsException ex = assertThrows(AwsException.class, () ->
|
||||
snsService.publish(topic.getTopicArn(), null, null, body, null, attrs, REGION));
|
||||
@@ -1014,10 +1014,10 @@ class SnsServiceTest {
|
||||
@Test
|
||||
void filterPolicy_messageAttributes_unchanged() {
|
||||
Subscription sub = subscriptionWithPolicy("{\"event\":[\"order\"]}", null);
|
||||
Map<String, io.github.hectorvent.floci.services.sqs.model.MessageAttributeValue> matching = Map.of(
|
||||
"event", new io.github.hectorvent.floci.services.sqs.model.MessageAttributeValue("order", "String"));
|
||||
Map<String, io.github.hectorvent.floci.services.sqs.model.MessageAttributeValue> nonMatching = Map.of(
|
||||
"event", new io.github.hectorvent.floci.services.sqs.model.MessageAttributeValue("refund", "String"));
|
||||
Map<String, MessageAttributeValue> matching = Map.of(
|
||||
"event", new MessageAttributeValue("order", "String"));
|
||||
Map<String, MessageAttributeValue> nonMatching = Map.of(
|
||||
"event", new MessageAttributeValue("refund", "String"));
|
||||
assertTrue(snsService.matchesFilterPolicy(sub, null, matching));
|
||||
assertFalse(snsService.matchesFilterPolicy(sub, null, nonMatching));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user