1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

Make XMPPError imutable and add stanza reference

This commit is contained in:
Florian Schmaus 2015-12-08 08:22:50 +01:00
parent 83eda4c58d
commit 45feaecdf7
30 changed files with 308 additions and 94 deletions

View file

@ -62,7 +62,7 @@ public class IQResponseTest {
*/
@Test
public void testGeneratingValidErrorResponse() throws XmppStringprepException {
final XMPPError error = new XMPPError(XMPPError.Condition.bad_request);
final XMPPError.Builder error = XMPPError.getBuilder(XMPPError.Condition.bad_request);
final IQ request = new TestIQ(ELEMENT, NAMESPACE);
request.setType(IQ.Type.set);
@ -75,7 +75,7 @@ public class IQResponseTest {
assertNotNull(result.getStanzaId());
assertEquals(request.getStanzaId(), result.getStanzaId());
assertEquals(request.getFrom(), result.getTo());
assertEquals(error, result.getError());
assertEquals(error.build().toXML(), result.getError().toXML());
// TODO this test was never valid
// assertEquals(CHILD_ELEMENT, result.getChildElementXML());
}
@ -110,7 +110,7 @@ public class IQResponseTest {
*/
@Test
public void testGeneratingErrorBasedOnError() throws XmppStringprepException {
final XMPPError error = new XMPPError(XMPPError.Condition.bad_request);
final XMPPError.Builder error = XMPPError.getBuilder(XMPPError.Condition.bad_request);
final IQ request = new TestIQ(ELEMENT, NAMESPACE);
request.setType(IQ.Type.error);