@Test
public void testEmptyDataForm() throws MalformedURLException {
DataForm dataForm = new DataForm(DataForm.Type.SUBMIT);
RequestVoiceForm requestVoiceForm = new RequestVoiceForm(dataForm);
requestVoiceForm.setJid(Jid.valueOf("hag66@shakespeare.lit/pda"));
DataForm.Field fieldJid = dataForm.findField("muc#jid");
Assert.assertNotNull(fieldJid);
Assert.assertEquals(fieldJid.getValues().size(), 1);
Assert.assertEquals(fieldJid.getValues().get(0), "hag66@shakespeare.lit/pda");
Assert.assertEquals(requestVoiceForm.getJid(), Jid.valueOf("hag66@shakespeare.lit/pda"));
requestVoiceForm.setRoomNick("thirdwitch");
DataForm.Field fieldRoomNick = dataForm.findField("muc#roomnick");
Assert.assertNotNull(fieldRoomNick);
Assert.assertEquals(fieldRoomNick.getValues().size(), 1);
Assert.assertEquals(fieldRoomNick.getValues().get(0), "thirdwitch");
Assert.assertEquals(requestVoiceForm.getRoomNick(), "thirdwitch");
requestVoiceForm.setRole(Role.PARTICIPANT);
DataForm.Field fieldRole = dataForm.findField("muc#role");
Assert.assertNotNull(fieldRole);
Assert.assertEquals(fieldRole.getValues().size(), 1);
Assert.assertEquals(fieldRole.getValues().get(0), "participant");
Assert.assertEquals(requestVoiceForm.getRole(), Role.PARTICIPANT);
requestVoiceForm.setRequestAllowed(true);
DataForm.Field fieldAllow = dataForm.findField("muc#request_allow");
Assert.assertNotNull(fieldAllow);
Assert.assertEquals(fieldAllow.getValues().size(), 1);
Assert.assertEquals(fieldAllow.getValues().get(0), "1");
Assert.assertTrue(requestVoiceForm.isRequestAllowed());
}