File tree 1 file changed +15
-4
lines changed
spring-web/src/test/java/org/springframework/http/codec/xml
1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2016 the original author or authors.
2
+ * Copyright 2002-2018 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
38
38
import org .springframework .http .codec .xml .jaxb .XmlTypeWithName ;
39
39
import org .springframework .http .codec .xml .jaxb .XmlTypeWithNameAndNamespace ;
40
40
41
- import static org .junit .Assert .assertEquals ;
42
- import static org .junit .Assert .assertFalse ;
43
- import static org .junit .Assert .assertTrue ;
41
+ import static org .junit .Assert .*;
44
42
45
43
/**
46
44
* @author Sebastien Deleuze
@@ -207,6 +205,19 @@ public void decodeMultipleXmlTypeElement() throws Exception {
207
205
.verify ();
208
206
}
209
207
208
+ @ Test
209
+ public void decodeError () throws Exception {
210
+ Flux <DataBuffer > source = Flux .just (stringBuffer ("<pojo>" ))
211
+ .concatWith (Flux .error (new RuntimeException ()));
212
+
213
+ Mono <Object > output = this .decoder .decodeToMono (source , ResolvableType .forClass (Pojo .class ),
214
+ null , Collections .emptyMap ());
215
+
216
+ StepVerifier .create (output )
217
+ .expectError (RuntimeException .class )
218
+ .verify ();
219
+ }
220
+
210
221
@ Test
211
222
public void toExpectedQName () {
212
223
assertEquals (new QName ("pojo" ), this .decoder .toQName (Pojo .class ));
You can’t perform that action at this time.
0 commit comments