@@ -29,46 +29,66 @@ public static void startup() {
2929
3030 @ Test
3131 public void objectCompletionRegistration () throws IOException , SignatureException {
32- final CreateNotificationResponse response = client .createObjectCachedNotification (new CreateObjectCachedNotificationRequest ("192.168.56.101" ));
32+ final NotificationResponse response = client .createObjectCachedNotification (new CreateObjectCachedNotificationRequest ("192.168.56.101" ));
3333 assertThat (response , is (notNullValue ()));
3434 assertThat (response .getRegistration (), is (notNullValue ()));
3535
3636 final UUID registrationId = response .getRegistration ().getId ();
3737
38+ final NotificationResponse getResponse = client .getObjectCachedNotification (new GetObjectCachedNotificationRequest (registrationId ));
39+ assertThat (getResponse , is (notNullValue ()));
40+ assertThat (getResponse .getRegistration (), is (notNullValue ()));
41+ assertThat (getResponse .getRegistration ().getId (), is (notNullValue ()));
42+
3843 assertThat (client .deleteObjectCachedNotification (new DeleteObjectCachedNotificationRequest (registrationId )), is (notNullValue ()));
3944
4045 }
4146
4247 @ Test
4348 public void jobCompletionRegistration () throws IOException , SignatureException {
44- final CreateNotificationResponse response = client .createJobCompletedNotification (new CreateJobCompletedNotificationRequest ("192.168.56.101/other" ));
49+ final NotificationResponse response = client .createJobCompletedNotification (new CreateJobCompletedNotificationRequest ("192.168.56.101/other" ));
4550 assertThat (response , is (notNullValue ()));
4651 assertThat (response .getRegistration (), is (notNullValue ()));
4752
4853 final UUID registrationId = response .getRegistration ().getId ();
4954
55+ final NotificationResponse getResponse = client .getJobCompletedNotification (new GetJobCompletedNotificationRequest (registrationId ));
56+ assertThat (getResponse , is (notNullValue ()));
57+ assertThat (getResponse .getRegistration (), is (notNullValue ()));
58+ assertThat (getResponse .getRegistration ().getId (), is (notNullValue ()));
59+
5060 assertThat (client .deleteJobCompleteNotification (new DeleteJobCompletedNotificationRequest (registrationId )), is (notNullValue ()));
5161 }
5262
5363 @ Test
5464 public void jobCreateRegistration () throws IOException , SignatureException {
55- final CreateNotificationResponse response = client .createJobCreatedNotification (new CreateJobCreatedNotificationRequest ("192.168.56.101/other" ));
65+ final NotificationResponse response = client .createJobCreatedNotification (new CreateJobCreatedNotificationRequest ("192.168.56.101/other" ));
5666 assertThat (response , is (notNullValue ()));
5767 assertThat (response .getRegistration (), is (notNullValue ()));
5868
5969 final UUID registrationId = response .getRegistration ().getId ();
6070
71+ final NotificationResponse getResponse = client .getJobCreatedNotification (new GetJobCreatedNotificationRequest (registrationId ));
72+ assertThat (getResponse , is (notNullValue ()));
73+ assertThat (getResponse .getRegistration (), is (notNullValue ()));
74+ assertThat (getResponse .getRegistration ().getId (), is (notNullValue ()));
75+
6176 assertThat (client .deleteJobCreatedNotification (new DeleteJobCreatedNotificationRequest (registrationId )), is (notNullValue ()));
6277 }
6378
6479 @ Test
6580 public void objectLostRegistration () throws IOException , SignatureException {
66- final CreateNotificationResponse response = client .createObjectLostNotification (new CreateObjectLostNotificationRequest ("192.168.56.101/other" ));
81+ final NotificationResponse response = client .createObjectLostNotification (new CreateObjectLostNotificationRequest ("192.168.56.101/other" ));
6782 assertThat (response , is (notNullValue ()));
6883 assertThat (response .getRegistration (), is (notNullValue ()));
6984
7085 final UUID registrationId = response .getRegistration ().getId ();
7186
87+ final NotificationResponse getResponse = client .getObjectLostNotification (new GetObjectLostNotificationRequest (registrationId ));
88+ assertThat (getResponse , is (notNullValue ()));
89+ assertThat (getResponse .getRegistration (), is (notNullValue ()));
90+ assertThat (getResponse .getRegistration ().getId (), is (notNullValue ()));
91+
7292 assertThat (client .deleteObjectLostNotification (new DeleteObjectLostNotificationRequest (registrationId )), is (notNullValue ()));
7393 }
7494
@@ -80,18 +100,55 @@ public void objectPersistedRegistration() throws IOException, SignatureException
80100 client .putBucket (new PutBucketRequest (bucketName ));
81101 final Ds3ClientHelpers .Job job = Util .getLoadJob (client , bucketName , Util .RESOURCE_BASE_NAME );
82102
83- final CreateNotificationResponse response = client .createObjectPersistedNotification (new CreateObjectPersistedNotificationRequest ("192.168.56.101/other" , job .getJobId ()));
103+ final NotificationResponse response = client .createObjectPersistedNotification (new CreateObjectPersistedNotificationRequest ("192.168.56.101/other" , job .getJobId ()));
84104 assertThat (response , is (notNullValue ()));
85105 assertThat (response .getRegistration (), is (notNullValue ()));
86106
87107 job .transfer (new ResourceObjectPutter (Util .RESOURCE_BASE_NAME ));
88108
89109 final UUID registrationId = response .getRegistration ().getId ();
90110
111+ final NotificationResponse getResponse = client .getObjectPersistedNotification (new GetObjectPersistedNotificationRequest (registrationId ));
112+ assertThat (getResponse , is (notNullValue ()));
113+ assertThat (getResponse .getRegistration (), is (notNullValue ()));
114+ assertThat (getResponse .getRegistration ().getId (), is (notNullValue ()));
115+
91116 assertThat (client .deleteObjectPersistedNotification (new DeleteObjectPersistedNotificationRequest (registrationId )), is (notNullValue ()));
92117 }
93118 finally {
94119 Util .deleteAllContents (client , bucketName );
95120 }
96121 }
122+
123+ @ Test
124+ public void partitionFailureRegistration () throws IOException , SignatureException {
125+ final NotificationResponse response = client .createPartitionFailureNotification (new CreatePartitionFailureNotificationRequest ("192.168.56.101/other" ));
126+ assertThat (response , is (notNullValue ()));
127+ assertThat (response .getRegistration (), is (notNullValue ()));
128+
129+ final UUID registrationId = response .getRegistration ().getId ();
130+
131+ final NotificationResponse getResponse = client .getPartitionFailureNotification (new GetPartitionFailureNotificationRequest (registrationId ));
132+ assertThat (getResponse , is (notNullValue ()));
133+ assertThat (getResponse .getRegistration (), is (notNullValue ()));
134+ assertThat (getResponse .getRegistration ().getId (), is (notNullValue ()));
135+
136+ assertThat (client .deletePartitionFailureNotification (new DeletePartitionFailureNotificationRequest (registrationId )), is (notNullValue ()));
137+ }
138+
139+ @ Test
140+ public void tapeFailureRegistration () throws IOException , SignatureException {
141+ final NotificationResponse response = client .createTapeFailureNotification (new CreateTapeFailureNotificationRequest ("192.168.56.101/other" ));
142+ assertThat (response , is (notNullValue ()));
143+ assertThat (response .getRegistration (), is (notNullValue ()));
144+
145+ final UUID registrationId = response .getRegistration ().getId ();
146+
147+ final NotificationResponse getResponse = client .getTapeFailureNotification (new GetTapeFailureNotificationRequest (registrationId ));
148+ assertThat (getResponse , is (notNullValue ()));
149+ assertThat (getResponse .getRegistration (), is (notNullValue ()));
150+ assertThat (getResponse .getRegistration ().getId (), is (notNullValue ()));
151+
152+ assertThat (client .deleteTapeFailureNotification (new DeleteTapeFailureNotificationRequest (registrationId )), is (notNullValue ()));
153+ }
97154}
0 commit comments