2
2
3
3
import com .exceptionless .exceptionlessclient .TestFixtures ;
4
4
import com .exceptionless .exceptionlessclient .configuration .Configuration ;
5
- import com .exceptionless .exceptionlessclient .exceptions .SubmissionException ;
5
+ import com .exceptionless .exceptionlessclient .exceptions .SubmissionClientException ;
6
6
import com .exceptionless .exceptionlessclient .models .Event ;
7
7
import com .exceptionless .exceptionlessclient .models .submission .SubmissionResponse ;
8
8
import com .exceptionless .exceptionlessclient .storage .InMemoryStorage ;
@@ -63,7 +63,7 @@ public void itCanProcessABatchSuccessfully() {
63
63
storage .save (event );
64
64
65
65
SubmissionResponse response =
66
- SubmissionResponse .builder ().message ("test-message" ).statusCode (200 ).build ();
66
+ SubmissionResponse .builder ().body ("test-message" ).code (200 ).build ();
67
67
doReturn (response ).when (submissionClient ).postEvents (List .of (event ));
68
68
69
69
queue .onEventsPosted (testHandler );
@@ -80,7 +80,7 @@ public void itShouldNotProcessIfCurrentlyProcessingEvents()
80
80
storage .save (event );
81
81
82
82
SubmissionResponse response =
83
- SubmissionResponse .builder ().message ("test-message" ).statusCode (200 ).build ();
83
+ SubmissionResponse .builder ().body ("test-message" ).code (200 ).build ();
84
84
doAnswer (
85
85
invocationOnMock -> {
86
86
Thread .sleep (1000 );
@@ -111,7 +111,7 @@ public void itShouldNotPostEmptyEvents() {
111
111
public void itShouldSuspendProcessingOnClientException () {
112
112
storage .save (event );
113
113
114
- doThrow (new SubmissionException ("test" )).when (submissionClient ).postEvents (List .of (event ));
114
+ doThrow (new SubmissionClientException ("test" )).when (submissionClient ).postEvents (List .of (event ));
115
115
116
116
queue .onEventsPosted (testHandler );
117
117
queue .process ();
@@ -126,7 +126,7 @@ public void itShouldSuspendProcessingIfServiceIsUnavailable() {
126
126
storage .save (event );
127
127
128
128
SubmissionResponse response =
129
- SubmissionResponse .builder ().message ("test-message" ).statusCode (503 ).build ();
129
+ SubmissionResponse .builder ().body ("test-message" ).code (503 ).build ();
130
130
doReturn (response ).when (submissionClient ).postEvents (List .of (event ));
131
131
132
132
queue .onEventsPosted (testHandler );
@@ -142,7 +142,7 @@ public void itShouldSuspendAndDiscardProcessingAndClearQueueIfNoPayment() {
142
142
storage .save (event );
143
143
144
144
SubmissionResponse response =
145
- SubmissionResponse .builder ().message ("test-message" ).statusCode (402 ).build ();
145
+ SubmissionResponse .builder ().body ("test-message" ).code (402 ).build ();
146
146
doReturn (response ).when (submissionClient ).postEvents (List .of (event ));
147
147
148
148
queue .onEventsPosted (testHandler );
@@ -162,7 +162,7 @@ public void itShouldSuspendProcessingAndClearQueueIfUnableToAuthenticate() {
162
162
storage .save (event );
163
163
164
164
SubmissionResponse response =
165
- SubmissionResponse .builder ().message ("test-message" ).statusCode (401 ).build ();
165
+ SubmissionResponse .builder ().body ("test-message" ).code (401 ).build ();
166
166
doReturn (response ).when (submissionClient ).postEvents (List .of (event ));
167
167
168
168
queue .onEventsPosted (testHandler );
@@ -178,7 +178,7 @@ public void itShouldSuspendProcessingAndClearQueueForNotFoundResponse() {
178
178
storage .save (event );
179
179
180
180
SubmissionResponse response =
181
- SubmissionResponse .builder ().message ("test-message" ).statusCode (404 ).build ();
181
+ SubmissionResponse .builder ().body ("test-message" ).code (404 ).build ();
182
182
doReturn (response ).when (submissionClient ).postEvents (List .of (event ));
183
183
184
184
queue .onEventsPosted (testHandler );
@@ -194,7 +194,7 @@ public void itShouldSuspendProcessingAndClearQueueForBadRequest() {
194
194
storage .save (event );
195
195
196
196
SubmissionResponse response =
197
- SubmissionResponse .builder ().message ("test-message" ).statusCode (400 ).build ();
197
+ SubmissionResponse .builder ().body ("test-message" ).code (400 ).build ();
198
198
doReturn (response ).when (submissionClient ).postEvents (List .of (event ));
199
199
200
200
queue .onEventsPosted (testHandler );
@@ -210,7 +210,7 @@ public void itShouldSuspendProcessingByDefault() {
210
210
storage .save (event );
211
211
212
212
SubmissionResponse response =
213
- SubmissionResponse .builder ().message ("test-message" ).statusCode (-1 ).build ();
213
+ SubmissionResponse .builder ().body ("test-message" ).code (-1 ).build ();
214
214
doReturn (response ).when (submissionClient ).postEvents (List .of (event ));
215
215
216
216
queue .onEventsPosted (testHandler );
@@ -238,7 +238,7 @@ public void itShouldReduceSubmissionBatchSizeIfRequestEntitiesAreTooLarge() {
238
238
}
239
239
240
240
SubmissionResponse response =
241
- SubmissionResponse .builder ().message ("test-message" ).statusCode (413 ).build ();
241
+ SubmissionResponse .builder ().body ("test-message" ).code (413 ).build ();
242
242
doReturn (response ).when (submissionClient ).postEvents (anyList ());
243
243
244
244
queue .onEventsPosted (testHandler );
@@ -264,7 +264,7 @@ public void itShouldDiscardEventsIfItCantReduceSubmissionSizeAndRequestEntitiesA
264
264
}
265
265
266
266
SubmissionResponse response =
267
- SubmissionResponse .builder ().message ("test-message" ).statusCode (413 ).build ();
267
+ SubmissionResponse .builder ().body ("test-message" ).code (413 ).build ();
268
268
doReturn (response ).when (submissionClient ).postEvents (anyList ());
269
269
270
270
queue .onEventsPosted (testHandler );
@@ -290,12 +290,12 @@ public void itShouldResetSubmissionBatchSizeOnNextSuccessfulResponse() {
290
290
storage .save (event );
291
291
}
292
292
293
- doReturn (SubmissionResponse .builder ().message ("test-message" ).statusCode (413 ).build ())
293
+ doReturn (SubmissionResponse .builder ().body ("test-message" ).code (413 ).build ())
294
294
.when (submissionClient )
295
295
.postEvents (anyList ());
296
296
queue .process ();
297
297
298
- doReturn (SubmissionResponse .builder ().message ("test-message" ).statusCode (200 ).build ())
298
+ doReturn (SubmissionResponse .builder ().body ("test-message" ).code (200 ).build ())
299
299
.when (submissionClient )
300
300
.postEvents (anyList ());
301
301
queue .process ();
@@ -314,7 +314,7 @@ public void itShouldResetSubmissionBatchSizeOnNextSuccessfulResponse() {
314
314
public void itShouldProcessEventsUsingTimer () throws InterruptedException {
315
315
storage .save (event );
316
316
SubmissionResponse response =
317
- SubmissionResponse .builder ().message ("test-message" ).statusCode (200 ).build ();
317
+ SubmissionResponse .builder ().body ("test-message" ).code (200 ).build ();
318
318
doReturn (response ).when (submissionClient ).postEvents (List .of (event ));
319
319
320
320
Configuration configuration =
0 commit comments