@@ -90,26 +90,23 @@ public void testRequeueWithDlx() throws IOException, InterruptedException {
90
90
private void setupNonDlxTest (int maxLen , boolean unAcked ) throws IOException , InterruptedException {
91
91
declareQueue (maxLen , false );
92
92
fill (maxLen );
93
- if (unAcked )
94
- getUnacked (maxLen , null );
93
+ if (unAcked ) getUnacked (maxLen );
95
94
publish ("msg" + (maxLen + 1 ));
96
95
}
97
96
98
97
private void setupDlxTest (int maxLen , boolean unAcked ) throws IOException , InterruptedException {
99
98
declareQueue (maxLen , true );
100
99
fill (maxLen );
101
- if (unAcked )
102
- getUnacked (maxLen , null );
100
+ if (unAcked ) getUnacked (maxLen );
103
101
publish ("msg" + (maxLen + 1 ));
104
102
try {
105
103
Thread .sleep (100 );
106
104
} catch (InterruptedException _) { }
107
105
}
108
106
109
107
private void setupRequeueTest (int maxLen ) throws IOException , InterruptedException {
110
- List <Long > tags = new ArrayList <Long >(maxLen );
111
108
fill (maxLen );
112
- getUnacked (maxLen , tags );
109
+ List < Long > tags = getUnacked (maxLen );
113
110
fill (maxLen );
114
111
channel .basicNack (tags .get (0 ), false , true );
115
112
if (maxLen > 1 )
@@ -148,11 +145,12 @@ private void assertHead(int expectedLength, String expectedHeadPayload, String q
148
145
}
149
146
}
150
147
151
- private void getUnacked (int howMany , List <Long > acks ) throws IOException {
152
- for (;howMany > 0 ; howMany --){
148
+ private List <Long > getUnacked (int howMany ) throws IOException {
149
+ List <Long > tags = new ArrayList <Long >(howMany );
150
+ for (;howMany > 0 ; howMany --) {
153
151
GetResponse response = channel .basicGet (q , false );
154
- if (acks != null )
155
- acks .add (response .getEnvelope ().getDeliveryTag ());
152
+ tags .add (response .getEnvelope ().getDeliveryTag ());
156
153
}
154
+ return tags ;
157
155
}
158
- }
156
+ }
0 commit comments