@Test
	public void testStepWithAWSFolderCredentials() throws Exception {

		String folderCredentialsId = "folders-aws-creds";

		// Create a folder with credentials in its store
		Folder folder = jenkinsRule.jenkins.createProject(Folder.class, "folder" + jenkinsRule.jenkins.getItems().size());
		CredentialsStore folderStore = this.getFolderStore(folder);
		AmazonWebServicesCredentials amazonWebServicesCredentials = new AWSCredentialsImpl(CredentialsScope.GLOBAL,
				folderCredentialsId, "global-aws-access-key-id", "global-aws-secret-access-key", "Aws-Description",
				"Arn::Something:or:Other", "12345678");
		folderStore.addCredentials(Domain.global(), amazonWebServicesCredentials);
		SystemCredentialsProvider.getInstance().save();

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

		WorkflowJob job = folder.createProject(WorkflowJob.class, "testStepWithAWSFolderCredentials");
		job.setDefinition(new CpsFlowDefinition(""
				+ "node {\n"
				+ "  withAWS (credentials: '" + folderCredentialsId + "') {\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);
		jenkinsRule.assertLogContains("Constructing AWS Credentials", workflowRun);

	}
Test the behavior of the {@link WithAWSStep}

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