@Test
	public void testStepWithGlobalAWSCredentials() throws Exception {

		String globalCredentialsId = "global-aws-creds";

		List<String> credentialIds = new ArrayList<>();
		credentialIds.add(globalCredentialsId);

		AmazonWebServicesCredentials amazonWebServicesCredentials = new AWSCredentialsImpl(CredentialsScope.GLOBAL,
				globalCredentialsId, "global-aws-access-key-id", "global-aws-secret-access-key", "Aws-Description",
				"Arn::Something:or:Other", "12345678");

		SystemCredentialsProvider.getInstance().getCredentials().add(amazonWebServicesCredentials);
		SystemCredentialsProvider.getInstance().save();

		WorkflowJob job = jenkinsRule.jenkins.createProject(WorkflowJob.class, "testStepWithGlobalAWSCredentials");
		job.setDefinition(new CpsFlowDefinition(""
				+ "node {\n"
				+ "  withAWS (credentials: '" + globalCredentialsId + "') {\n"
				+ "    echo 'It works!'\n"
				+ "  }\n"
				+ "}\n", true)
		);


		WorkflowRun workflowRun = job.scheduleBuild2(0).get();
		jenkinsRule.waitForCompletion(workflowRun);
		jenkinsRule.assertBuildStatus(Result.FAILURE, workflowRun);
		jenkinsRule.assertLogContains("The security token included in the request is invalid.", workflowRun);
	}
Test the behavior of the {@link WithAWSStep}

@author Allan Burdajewicz
src/test/java/de/taimos/pipeline/aws/WithAWSStepTest.java