use of software.amazon.awssdk.aws.greengrass.model.ServiceError in project aws-greengrass-cli by aws-greengrass.
the class CLIEventStreamAgentTest method testCreateLocalDeployment_deployments_Q_not_initialized.
@Test
void testCreateLocalDeployment_deployments_Q_not_initialized(ExtensionContext context) {
ignoreExceptionOfType(context, ServiceError.class);
// set it to be not initialized
cliEventStreamAgent.setDeploymentQueue(null);
Topics mockCliConfig = mock(Topics.class);
CreateLocalDeploymentRequest request = new CreateLocalDeploymentRequest();
try {
cliEventStreamAgent.getCreateLocalDeploymentHandler(mockContext, mockCliConfig).handleRequest(request);
} catch (ServiceError e) {
assertEquals(DEPLOYMENTS_QUEUE_NOT_INITIALIZED, e.getMessage());
return;
}
fail();
}
use of software.amazon.awssdk.aws.greengrass.model.ServiceError in project aws-greengrass-nucleus by aws-greengrass.
the class LifecycleIPCEventStreamAgentTest method GIVEN_resume_component_request_WHEN_not_on_linux_THEN_throws_unsupported_operation_exception.
@Test
@DisabledOnOs(OS.LINUX)
void GIVEN_resume_component_request_WHEN_not_on_linux_THEN_throws_unsupported_operation_exception() {
ResumeComponentRequest request = new ResumeComponentRequest();
request.setComponentName(TEST_TARGET_COMPONENT);
ServiceError exception = assertThrows(ServiceError.class, () -> lifecycleIPCEventStreamAgent.getResumeComponentHandler(mockContext).handleRequest(request));
assertThat(exception.getMessage(), containsString("Pause/resume component not supported on this platform"));
}
use of software.amazon.awssdk.aws.greengrass.model.ServiceError in project aws-greengrass-nucleus by aws-greengrass.
the class LifecycleIPCEventStreamAgentTest method GIVEN_pause_component_request_WHEN_not_on_linux_THEN_throws_unsupported_operation_exception.
@Test
@DisabledOnOs(OS.LINUX)
void GIVEN_pause_component_request_WHEN_not_on_linux_THEN_throws_unsupported_operation_exception() {
PauseComponentRequest request = new PauseComponentRequest();
request.setComponentName(TEST_TARGET_COMPONENT);
ServiceError exception = assertThrows(ServiceError.class, () -> lifecycleIPCEventStreamAgent.getPauseComponentHandler(mockContext).handleRequest(request));
assertThat(exception.getMessage(), containsString("Pause/resume component not supported on this platform"));
}
Aggregations