summaryrefslogtreecommitdiffstats
blob: babaad18ef6fe3992d5829dbf8c2c2f399716cc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package com.isode.stroke.serializer.payloadserializers;

import static org.junit.Assert.assertEquals;

import org.junit.BeforeClass;
import org.junit.Test;
import src.com.isode.stroke.elements.CapsInfo;
import src.com.isode.stroke.serializer.payloadserializers.CapsInfoSerializer;

public class CapsInfoSerializerTest {

	@Test
	public void testSerialize() {
		CapsInfoSerializer testling = new CapsInfoSerializer();
		CapsInfo priority = new CapsInfo("http://swift.im", "myversion", "sha-1");
		String expected = "<c hash=\"sha-1\" node=\"http://swift.im\" ver=\"myversion\" xmlns=\"http://jabber.org/protocol/caps\"/>";
		assertEquals(expected, testling.serialize(priority));
	}
}