17
17
18
18
import static org .junit .Assert .assertNotNull ;
19
19
20
+ import org .junit .AfterClass ;
20
21
import org .junit .BeforeClass ;
21
22
import org .junit .Test ;
22
23
import software .amazon .awssdk .core .exception .SdkServiceException ;
23
24
import software .amazon .awssdk .regions .Region ;
24
25
import software .amazon .awssdk .services .devicefarm .model .CreateProjectRequest ;
25
26
import software .amazon .awssdk .services .devicefarm .model .CreateProjectResponse ;
27
+ import software .amazon .awssdk .services .devicefarm .model .DeleteProjectRequest ;
26
28
import software .amazon .awssdk .services .devicefarm .model .ListDevicePoolsRequest ;
27
29
import software .amazon .awssdk .services .devicefarm .model .Project ;
28
30
import software .amazon .awssdk .testutils .service .AwsTestBase ;
@@ -36,6 +38,8 @@ public class DeviceFarmIntegrationTest extends AwsTestBase {
36
38
+ System .currentTimeMillis ();
37
39
private static DeviceFarmClient client ;
38
40
41
+ private static String projectArn ;
42
+
39
43
@ BeforeClass
40
44
public static void setup () throws Exception {
41
45
setUpCredentials ();
@@ -45,6 +49,11 @@ public static void setup() throws Exception {
45
49
.build ();
46
50
}
47
51
52
+ @ AfterClass
53
+ public static void teardown () {
54
+ client .deleteProject (DeleteProjectRequest .builder ().arn (projectArn ).build ());
55
+ }
56
+
48
57
@ Test
49
58
public void testCreateProject () {
50
59
CreateProjectResponse result = client
@@ -53,7 +62,8 @@ public void testCreateProject() {
53
62
.build ());
54
63
final Project project = result .project ();
55
64
assertNotNull (project );
56
- assertNotNull (project .arn ());
65
+ projectArn = project .arn ();
66
+ assertNotNull (projectArn );
57
67
}
58
68
59
69
@ Test (expected = SdkServiceException .class )
0 commit comments