forked from awslabs/aws-codedeploy-plugin
-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathAWSCodeDeployPublisherTest.java
More file actions
56 lines (50 loc) · 1.67 KB
/
AWSCodeDeployPublisherTest.java
File metadata and controls
56 lines (50 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package com.amazonaws.codedeploy;
import hudson.model.FreeStyleProject;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.recipes.LocalData;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertThat;
public class AWSCodeDeployPublisherTest {
@Rule
public JenkinsRule j = new JenkinsRule();
@Test
public void testRoundTripConfiguration() throws Exception {
final AWSCodeDeployPublisher publisher = new AWSCodeDeployPublisher(
"testBucket",
"testPrefix",
"",
"",
"testApplicationName",
"testDeploymentGroupName",
"testDeploymentConfig",
"us-west-2",
false,
true,
60L,
10L,
"awsAccessKey",
"",
"deploy",
"testAccessKey",
"testSecretKey",
"",
null,
"",
"",
0,
"",
"");
final AWSCodeDeployPublisher afterPublisher = j.configRoundtrip(publisher);
j.assertEqualDataBoundBeans(publisher, afterPublisher);
}
@Test
@LocalData
public void testSaveUsesSecret() throws Exception {
FreeStyleProject project = (FreeStyleProject) j.jenkins.getItem("testSecrets");
FreeStyleProject after = j.configRoundtrip(project);
assertThat(after.getConfigFile().asString(), not(containsString("TEST_SECRET")));
}
}