OPNFLWPLUG-1032: Neon-MRI: Bump odlparent, yangtools, mdsal
[openflowplugin.git] / openflowjava / openflow-protocol-impl / src / test / java / org / opendaylight / openflowjava / protocol / impl / deserialization / factories / ErrorMessageFactoryTest.java
1 /*
2  * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowjava.protocol.impl.deserialization.factories;
10
11 import static org.mockito.ArgumentMatchers.any;
12
13 import io.netty.buffer.ByteBuf;
14 import org.junit.Assert;
15 import org.junit.Before;
16 import org.junit.Test;
17 import org.junit.runner.RunWith;
18 import org.mockito.Mock;
19 import org.mockito.Mockito;
20 import org.mockito.runners.MockitoJUnitRunner;
21 import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry;
22 import org.opendaylight.openflowjava.protocol.api.keys.MessageCodeKey;
23 import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ErrorMessage;
25
26 /**
27  * Unit tests for ErrorMessageFactory.
28  *
29  * @author michal.polkorab
30  * @author timotej.kubas
31  */
32 @RunWith(MockitoJUnitRunner.class)
33 public class ErrorMessageFactoryTest {
34
35     @Mock DeserializerRegistry registry;
36     @Mock ErrorMessageFactory deserializer;
37
38     private ErrorMessageFactory errorFactory;
39
40     /**
41      * Initializes deserializer registry and lookups correct deserializer..
42      */
43     @Before
44     public void startUp() {
45         errorFactory = new ErrorMessageFactory();
46         Mockito.when(registry.getDeserializer(any(MessageCodeKey.class))).thenReturn(deserializer);
47         errorFactory.injectDeserializerRegistry(registry);
48     }
49
50     /**
51      * Test of {@link ErrorMessageFactory} for correct translation into POJO.
52      */
53     @Test
54     public void testWithoutData() {
55         ByteBuf bb = BufferHelper.buildBuffer("00 00 00 00");
56         ErrorMessage builtByFactory = BufferHelper.deserialize(errorFactory, bb);
57
58         BufferHelper.checkHeaderV13(builtByFactory);
59         Assert.assertEquals("Wrong type", 0, builtByFactory.getType().intValue());
60         Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue());
61         Assert.assertEquals("Wrong type string", "HELLOFAILED", builtByFactory.getTypeString());
62         Assert.assertEquals("Wrong code string", "INCOMPATIBLE", builtByFactory.getCodeString());
63         Assert.assertNull("Data is not null", builtByFactory.getData());
64
65         bb = BufferHelper.buildBuffer("00 01 00 00");
66         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
67
68         BufferHelper.checkHeaderV13(builtByFactory);
69         Assert.assertEquals("Wrong type", 1, builtByFactory.getType().intValue());
70         Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue());
71         Assert.assertEquals("Wrong type string", "BADREQUEST", builtByFactory.getTypeString());
72         Assert.assertEquals("Wrong code string", "BADVERSION", builtByFactory.getCodeString());
73         Assert.assertNull("Data is not null", builtByFactory.getData());
74
75         bb = BufferHelper.buildBuffer("00 02 00 00");
76         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
77
78         BufferHelper.checkHeaderV13(builtByFactory);
79         Assert.assertEquals("Wrong type", 2, builtByFactory.getType().intValue());
80         Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue());
81         Assert.assertEquals("Wrong type string", "BADACTION", builtByFactory.getTypeString());
82         Assert.assertEquals("Wrong code string", "BADTYPE", builtByFactory.getCodeString());
83         Assert.assertNull("Data is not null", builtByFactory.getData());
84
85         bb = BufferHelper.buildBuffer("00 03 00 00");
86         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
87
88         BufferHelper.checkHeaderV13(builtByFactory);
89         Assert.assertEquals("Wrong type", 3, builtByFactory.getType().intValue());
90         Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue());
91         Assert.assertEquals("Wrong type string", "BADINSTRUCTION", builtByFactory.getTypeString());
92         Assert.assertEquals("Wrong code string", "UNKNOWNINST", builtByFactory.getCodeString());
93         Assert.assertNull("Data is not null", builtByFactory.getData());
94
95         bb = BufferHelper.buildBuffer("00 04 00 00");
96         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
97
98         BufferHelper.checkHeaderV13(builtByFactory);
99         Assert.assertEquals("Wrong type", 4, builtByFactory.getType().intValue());
100         Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue());
101         Assert.assertEquals("Wrong type string", "BADMATCH", builtByFactory.getTypeString());
102         Assert.assertEquals("Wrong code string", "BADTYPE", builtByFactory.getCodeString());
103         Assert.assertNull("Data is not null", builtByFactory.getData());
104
105         bb = BufferHelper.buildBuffer("00 05 00 00");
106         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
107
108         BufferHelper.checkHeaderV13(builtByFactory);
109         Assert.assertEquals("Wrong type", 5, builtByFactory.getType().intValue());
110         Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue());
111         Assert.assertEquals("Wrong type string", "FLOWMODFAILED", builtByFactory.getTypeString());
112         Assert.assertEquals("Wrong code string", "UNKNOWN", builtByFactory.getCodeString());
113         Assert.assertNull("Data is not null", builtByFactory.getData());
114
115         bb = BufferHelper.buildBuffer("00 06 00 00");
116         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
117
118         BufferHelper.checkHeaderV13(builtByFactory);
119         Assert.assertEquals("Wrong type", 6, builtByFactory.getType().intValue());
120         Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue());
121         Assert.assertEquals("Wrong type string", "GROUPMODFAILED", builtByFactory.getTypeString());
122         Assert.assertEquals("Wrong code string", "GROUPEXISTS", builtByFactory.getCodeString());
123         Assert.assertNull("Data is not null", builtByFactory.getData());
124
125         bb = BufferHelper.buildBuffer("00 07 00 00");
126         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
127
128         BufferHelper.checkHeaderV13(builtByFactory);
129         Assert.assertEquals("Wrong type", 7, builtByFactory.getType().intValue());
130         Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue());
131         Assert.assertEquals("Wrong type string", "PORTMODFAILED", builtByFactory.getTypeString());
132         Assert.assertEquals("Wrong code string", "BADPORT", builtByFactory.getCodeString());
133         Assert.assertNull("Data is not null", builtByFactory.getData());
134
135         bb = BufferHelper.buildBuffer("00 08 00 00");
136         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
137
138         BufferHelper.checkHeaderV13(builtByFactory);
139         Assert.assertEquals("Wrong type", 8, builtByFactory.getType().intValue());
140         Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue());
141         Assert.assertEquals("Wrong type string", "TABLEMODFAILED", builtByFactory.getTypeString());
142         Assert.assertEquals("Wrong code string", "BADTABLE", builtByFactory.getCodeString());
143         Assert.assertNull("Data is not null", builtByFactory.getData());
144
145         bb = BufferHelper.buildBuffer("00 09 00 00");
146         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
147
148         BufferHelper.checkHeaderV13(builtByFactory);
149         Assert.assertEquals("Wrong type", 9, builtByFactory.getType().intValue());
150         Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue());
151         Assert.assertEquals("Wrong type string", "QUEUEOPFAILED", builtByFactory.getTypeString());
152         Assert.assertEquals("Wrong code string", "BADPORT", builtByFactory.getCodeString());
153         Assert.assertNull("Data is not null", builtByFactory.getData());
154
155         bb = BufferHelper.buildBuffer("00 0A 00 00");
156         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
157
158         BufferHelper.checkHeaderV13(builtByFactory);
159         Assert.assertEquals("Wrong type", 10, builtByFactory.getType().intValue());
160         Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue());
161         Assert.assertEquals("Wrong type string", "SWITCHCONFIGFAILED", builtByFactory.getTypeString());
162         Assert.assertEquals("Wrong code string", "BADFLAGS", builtByFactory.getCodeString());
163         Assert.assertNull("Data is not null", builtByFactory.getData());
164
165         bb = BufferHelper.buildBuffer("00 0B 00 00");
166         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
167
168         BufferHelper.checkHeaderV13(builtByFactory);
169         Assert.assertEquals("Wrong type", 11, builtByFactory.getType().intValue());
170         Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue());
171         Assert.assertEquals("Wrong type string", "ROLEREQUESTFAILED", builtByFactory.getTypeString());
172         Assert.assertEquals("Wrong code string", "STALE", builtByFactory.getCodeString());
173         Assert.assertNull("Data is not null", builtByFactory.getData());
174
175         bb = BufferHelper.buildBuffer("00 0C 00 00");
176         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
177
178         BufferHelper.checkHeaderV13(builtByFactory);
179         Assert.assertEquals("Wrong type", 12, builtByFactory.getType().intValue());
180         Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue());
181         Assert.assertEquals("Wrong type string", "METERMODFAILED", builtByFactory.getTypeString());
182         Assert.assertEquals("Wrong code string", "UNKNOWN", builtByFactory.getCodeString());
183         Assert.assertNull("Data is not null", builtByFactory.getData());
184
185         bb = BufferHelper.buildBuffer("00 0D 00 00");
186         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
187
188         BufferHelper.checkHeaderV13(builtByFactory);
189         Assert.assertEquals("Wrong type", 13, builtByFactory.getType().intValue());
190         Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue());
191         Assert.assertEquals("Wrong type string", "TABLEFEATURESFAILED", builtByFactory.getTypeString());
192         Assert.assertEquals("Wrong code string", "BADTABLE", builtByFactory.getCodeString());
193         Assert.assertNull("Data is not null", builtByFactory.getData());
194     }
195
196     /**
197      * Test of {@link ErrorMessageFactory} for correct translation into POJO
198      * - not existing code used.
199      */
200     @Test
201     public void testWithoutData2() {
202         ByteBuf bb = BufferHelper.buildBuffer("00 00 FF FF");
203         ErrorMessage builtByFactory = BufferHelper.deserialize(errorFactory, bb);
204
205         BufferHelper.checkHeaderV13(builtByFactory);
206         Assert.assertEquals("Wrong type", 0, builtByFactory.getType().intValue());
207         Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue());
208         Assert.assertEquals("Wrong type string", "HELLOFAILED", builtByFactory.getTypeString());
209         Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString());
210         Assert.assertNull("Data is not null", builtByFactory.getData());
211
212         bb = BufferHelper.buildBuffer("00 01 FF FF");
213         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
214
215         BufferHelper.checkHeaderV13(builtByFactory);
216         Assert.assertEquals("Wrong type", 1, builtByFactory.getType().intValue());
217         Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue());
218         Assert.assertEquals("Wrong type string", "BADREQUEST", builtByFactory.getTypeString());
219         Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString());
220         Assert.assertNull("Data is not null", builtByFactory.getData());
221
222         bb = BufferHelper.buildBuffer("00 02 FF FF");
223         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
224
225         BufferHelper.checkHeaderV13(builtByFactory);
226         Assert.assertEquals("Wrong type", 2, builtByFactory.getType().intValue());
227         Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue());
228         Assert.assertEquals("Wrong type string", "BADACTION", builtByFactory.getTypeString());
229         Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString());
230         Assert.assertNull("Data is not null", builtByFactory.getData());
231
232         bb = BufferHelper.buildBuffer("00 03 FF FF");
233         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
234
235         BufferHelper.checkHeaderV13(builtByFactory);
236         Assert.assertEquals("Wrong type", 3, builtByFactory.getType().intValue());
237         Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue());
238         Assert.assertEquals("Wrong type string", "BADINSTRUCTION", builtByFactory.getTypeString());
239         Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString());
240         Assert.assertNull("Data is not null", builtByFactory.getData());
241
242         bb = BufferHelper.buildBuffer("00 04 FF FF");
243         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
244
245         BufferHelper.checkHeaderV13(builtByFactory);
246         Assert.assertEquals("Wrong type", 4, builtByFactory.getType().intValue());
247         Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue());
248         Assert.assertEquals("Wrong type string", "BADMATCH", builtByFactory.getTypeString());
249         Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString());
250         Assert.assertNull("Data is not null", builtByFactory.getData());
251
252         bb = BufferHelper.buildBuffer("00 05 FF FF");
253         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
254
255         BufferHelper.checkHeaderV13(builtByFactory);
256         Assert.assertEquals("Wrong type", 5, builtByFactory.getType().intValue());
257         Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue());
258         Assert.assertEquals("Wrong type string", "FLOWMODFAILED", builtByFactory.getTypeString());
259         Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString());
260         Assert.assertNull("Data is not null", builtByFactory.getData());
261
262         bb = BufferHelper.buildBuffer("00 06 FF FF");
263         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
264
265         BufferHelper.checkHeaderV13(builtByFactory);
266         Assert.assertEquals("Wrong type", 6, builtByFactory.getType().intValue());
267         Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue());
268         Assert.assertEquals("Wrong type string", "GROUPMODFAILED", builtByFactory.getTypeString());
269         Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString());
270         Assert.assertNull("Data is not null", builtByFactory.getData());
271
272         bb = BufferHelper.buildBuffer("00 07 FF FF");
273         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
274
275         BufferHelper.checkHeaderV13(builtByFactory);
276         Assert.assertEquals("Wrong type", 7, builtByFactory.getType().intValue());
277         Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue());
278         Assert.assertEquals("Wrong type string", "PORTMODFAILED", builtByFactory.getTypeString());
279         Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString());
280         Assert.assertNull("Data is not null", builtByFactory.getData());
281
282         bb = BufferHelper.buildBuffer("00 08 FF FF");
283         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
284
285         BufferHelper.checkHeaderV13(builtByFactory);
286         Assert.assertEquals("Wrong type", 8, builtByFactory.getType().intValue());
287         Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue());
288         Assert.assertEquals("Wrong type string", "TABLEMODFAILED", builtByFactory.getTypeString());
289         Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString());
290         Assert.assertNull("Data is not null", builtByFactory.getData());
291
292         bb = BufferHelper.buildBuffer("00 09 FF FF");
293         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
294
295         BufferHelper.checkHeaderV13(builtByFactory);
296         Assert.assertEquals("Wrong type", 9, builtByFactory.getType().intValue());
297         Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue());
298         Assert.assertEquals("Wrong type string", "QUEUEOPFAILED", builtByFactory.getTypeString());
299         Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString());
300         Assert.assertNull("Data is not null", builtByFactory.getData());
301
302         bb = BufferHelper.buildBuffer("00 0A FF FF");
303         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
304
305         BufferHelper.checkHeaderV13(builtByFactory);
306         Assert.assertEquals("Wrong type", 10, builtByFactory.getType().intValue());
307         Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue());
308         Assert.assertEquals("Wrong type string", "SWITCHCONFIGFAILED", builtByFactory.getTypeString());
309         Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString());
310         Assert.assertNull("Data is not null", builtByFactory.getData());
311
312         bb = BufferHelper.buildBuffer("00 0B FF FF");
313         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
314
315         BufferHelper.checkHeaderV13(builtByFactory);
316         Assert.assertEquals("Wrong type", 11, builtByFactory.getType().intValue());
317         Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue());
318         Assert.assertEquals("Wrong type string", "ROLEREQUESTFAILED", builtByFactory.getTypeString());
319         Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString());
320         Assert.assertNull("Data is not null", builtByFactory.getData());
321
322         bb = BufferHelper.buildBuffer("00 0C FF FF");
323         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
324
325         BufferHelper.checkHeaderV13(builtByFactory);
326         Assert.assertEquals("Wrong type", 12, builtByFactory.getType().intValue());
327         Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue());
328         Assert.assertEquals("Wrong type string", "METERMODFAILED", builtByFactory.getTypeString());
329         Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString());
330         Assert.assertNull("Data is not null", builtByFactory.getData());
331
332         bb = BufferHelper.buildBuffer("00 0D FF FF");
333         builtByFactory = BufferHelper.deserialize(errorFactory, bb);
334
335         BufferHelper.checkHeaderV13(builtByFactory);
336         Assert.assertEquals("Wrong type", 13, builtByFactory.getType().intValue());
337         Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue());
338         Assert.assertEquals("Wrong type string", "TABLEFEATURESFAILED", builtByFactory.getTypeString());
339         Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString());
340         Assert.assertNull("Data is not null", builtByFactory.getData());
341     }
342
343     /**
344      * Test of {@link ErrorMessageFactory} for correct translation into POJO.
345      */
346     @Test
347     public void testWithData() {
348         ByteBuf bb = BufferHelper.buildBuffer("00 00 00 01 00 01 02 03");
349         ErrorMessage builtByFactory = BufferHelper.deserialize(errorFactory, bb);
350
351         BufferHelper.checkHeaderV13(builtByFactory);
352         Assert.assertEquals("Wrong type", 0, builtByFactory.getType().intValue());
353         Assert.assertEquals("Wrong code", 1, builtByFactory.getCode().intValue());
354         Assert.assertEquals("Wrong type string", "HELLOFAILED", builtByFactory.getTypeString());
355         Assert.assertEquals("Wrong code string", "EPERM", builtByFactory.getCodeString());
356         Assert.assertArrayEquals("Wrong data", new byte[]{0x00, 0x01, 0x02, 0x03}, builtByFactory.getData());
357     }
358
359     /**
360      * Test of {@link ErrorMessageFactory} for correct translation into POJO.
361      */
362     @Test
363     public void testWithIncorrectTypeEnum() {
364         ByteBuf bb = BufferHelper.buildBuffer("00 20 00 05 00 01 02 03");
365         ErrorMessage builtByFactory = BufferHelper.deserialize(errorFactory, bb);
366
367         BufferHelper.checkHeaderV13(builtByFactory);
368         Assert.assertEquals("Wrong type", 32, builtByFactory.getType().intValue());
369         Assert.assertEquals("Wrong code", 5, builtByFactory.getCode().intValue());
370         Assert.assertEquals("Wrong type string", "UNKNOWN_TYPE", builtByFactory.getTypeString());
371         Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString());
372         Assert.assertArrayEquals("Wrong data", new byte[]{0x00, 0x01, 0x02, 0x03}, builtByFactory.getData());
373     }
374
375     /**
376      * Test of {@link ErrorMessageFactory} for correct translation into POJO.
377      */
378     @Test
379     public void testWithIncorrectCodeEnum() {
380         ByteBuf bb = BufferHelper.buildBuffer("00 03 00 10 00 01 02 03");
381         ErrorMessage builtByFactory = BufferHelper.deserialize(errorFactory, bb);
382
383         BufferHelper.checkHeaderV13(builtByFactory);
384         Assert.assertEquals("Wrong type", 3, builtByFactory.getType().intValue());
385         Assert.assertEquals("Wrong code", 16, builtByFactory.getCode().intValue());
386         Assert.assertEquals("Wrong type string", "BADINSTRUCTION", builtByFactory.getTypeString());
387         Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString());
388         Assert.assertArrayEquals("Wrong data", new byte[]{0x00, 0x01, 0x02, 0x03}, builtByFactory.getData());
389     }
390
391     /**
392      * Test of {@link ErrorMessageFactory} for correct translation into POJO.
393      */
394     @Test
395     public void testExperimenterError() {
396         ByteBuf bb = BufferHelper.buildBuffer("FF FF 00 00 00 01");
397         BufferHelper.deserialize(errorFactory, bb);
398
399         Mockito.verify(deserializer, Mockito.times(1)).deserialize(bb);
400     }
401 }