diff --git a/server/pom.xml b/server/pom.xml index f4c93b1..63cc31e 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -211,7 +211,7 @@ com.aws.greengrass nucleus - 2.5.0-SNAPSHOT + 2.6.0-SNAPSHOT provided diff --git a/server/src/test/java/com/aws/greengrass/cli/IPCCliTest.java b/server/src/test/java/com/aws/greengrass/cli/IPCCliTest.java index 926d8aa..c6c86a9 100644 --- a/server/src/test/java/com/aws/greengrass/cli/IPCCliTest.java +++ b/server/src/test/java/com/aws/greengrass/cli/IPCCliTest.java @@ -37,6 +37,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtensionContext; import software.amazon.awssdk.aws.greengrass.GreengrassCoreIPCClient; +import software.amazon.awssdk.aws.greengrass.GreengrassCoreIPCClientV2; import software.amazon.awssdk.aws.greengrass.model.ComponentDetails; import software.amazon.awssdk.aws.greengrass.model.CreateLocalDeploymentRequest; import software.amazon.awssdk.aws.greengrass.model.CreateLocalDeploymentResponse; @@ -161,6 +162,13 @@ void GIVEN_component_running_WHEN_get_component_request_made_THEN_service_detail assertNotNull(componentDetails); assertEquals("1.0.0", componentDetails.getVersion()); + + try(EventStreamRPCConnection connection = IPCTestUtils.getEventStreamRpcConnection(kernel, + "ServiceName")) { + GreengrassCoreIPCClientV2 client = + GreengrassCoreIPCClientV2.builder().withClient(new GreengrassCoreIPCClient(connection)).build(); + assertEquals(componentDetails, client.getComponentDetails(request).getComponentDetails()); + } } @Test @@ -198,11 +206,17 @@ void GIVEN_kernel_running_WHEN_list_component_request_made_THEN_components_detai clientConnection.listComponents(request, Optional.empty()).getResponse() .get(DEFAULT_TIMEOUT_IN_SEC, TimeUnit.SECONDS); List components = - listComponentsResponse.getComponents().stream().map(cd -> cd.getComponentName()).collect(Collectors.toList()); + listComponentsResponse.getComponents().stream().map(ComponentDetails::getComponentName).collect(Collectors.toList()); assertTrue(components.contains("mqtt")); assertTrue(components.contains(TEST_SERVICE_NAME)); assertFalse(components.contains("main")); + try(EventStreamRPCConnection connection = IPCTestUtils.getEventStreamRpcConnection(kernel, + "ServiceName")) { + GreengrassCoreIPCClientV2 client = + GreengrassCoreIPCClientV2.builder().withClient(new GreengrassCoreIPCClient(connection)).build(); + assertEquals(components, client.listComponents(request).getComponents().stream().map(ComponentDetails::getComponentName).collect(Collectors.toList())); + } } @Test diff --git a/server/src/test/resources/com/aws/greengrass/cli/ipc.yaml b/server/src/test/resources/com/aws/greengrass/cli/ipc.yaml index 08b496a..e2eb78c 100644 --- a/server/src/test/resources/com/aws/greengrass/cli/ipc.yaml +++ b/server/src/test/resources/com/aws/greengrass/cli/ipc.yaml @@ -20,6 +20,16 @@ services: lifecycle: {} version: 1.0.0 ServiceName: + configuration: + accessControl: + aws.greengrass.Cli: + testPolicy1: + policyDescription: "Test policy" + operations: + - aws.greengrass#GetComponentDetails + - aws.greengrass#ListComponents + resources: + - '*' lifecycle: run: windows: