@Test public void testConvertQuestion() throws Exception { QuestionFromFkType questionFromFK = inflateQuestionFromFK(); QuestionToFkType referenceQuestionToFK = inflateQuestionToFK(); FragaSvar fragaSvar = fragaSvarConverter.convert(questionFromFK); fragaSvar.setAmne(Amne.KONTAKT); fragaSvar.setInternReferens(321L); QuestionToFkType convertedQuestionToFK = FKQuestionConverter.convert(fragaSvar); String expected = jaxbToXml(referenceQuestionToFK); String actual = jaxbToXml(convertedQuestionToFK); assertEquals(expected, actual); }
public static QuestionToFkType convert(FragaSvar fs) { QuestionToFkType fkQuestion = new QuestionToFkType(); fkQuestion.setAmne(ConvertToFKTypes.toAmneTyp(fs.getAmne())); fkQuestion.setAdressVard(ConvertToFKTypes.toVardAdresseringsType(fs.getVardperson())); fkQuestion.setAvsantTidpunkt(fs.getFrageSkickadDatum()); fkQuestion.setFraga(ConvertToFKTypes.toInnehallType(fs.getFrageText(), fs.getFrageSigneringsDatum())); fkQuestion.setLakarutlatande(ConvertToFKTypes.toLakarUtlatande(fs.getIntygsReferens())); fkQuestion.setVardReferensId(fs.getInternReferens().toString()); return fkQuestion; }
FKQuestionConverter { public static QuestionToFkType convert(FragaSvar fs) { QuestionToFkType fkQuestion = new QuestionToFkType(); fkQuestion.setAmne(ConvertToFKTypes.toAmneTyp(fs.getAmne())); fkQuestion.setAdressVard(ConvertToFKTypes.toVardAdresseringsType(fs.getVardperson())); fkQuestion.setAvsantTidpunkt(fs.getFrageSkickadDatum()); fkQuestion.setFraga(ConvertToFKTypes.toInnehallType(fs.getFrageText(), fs.getFrageSigneringsDatum())); fkQuestion.setLakarutlatande(ConvertToFKTypes.toLakarUtlatande(fs.getIntygsReferens())); fkQuestion.setVardReferensId(fs.getInternReferens().toString()); return fkQuestion; } }
FKQuestionConverter { public static QuestionToFkType convert(FragaSvar fs) { QuestionToFkType fkQuestion = new QuestionToFkType(); fkQuestion.setAmne(ConvertToFKTypes.toAmneTyp(fs.getAmne())); fkQuestion.setAdressVard(ConvertToFKTypes.toVardAdresseringsType(fs.getVardperson())); fkQuestion.setAvsantTidpunkt(fs.getFrageSkickadDatum()); fkQuestion.setFraga(ConvertToFKTypes.toInnehallType(fs.getFrageText(), fs.getFrageSigneringsDatum())); fkQuestion.setLakarutlatande(ConvertToFKTypes.toLakarUtlatande(fs.getIntygsReferens())); fkQuestion.setVardReferensId(fs.getInternReferens().toString()); return fkQuestion; } private  FKQuestionConverter(); }
FKQuestionConverter { public static QuestionToFkType convert(FragaSvar fs) { QuestionToFkType fkQuestion = new QuestionToFkType(); fkQuestion.setAmne(ConvertToFKTypes.toAmneTyp(fs.getAmne())); fkQuestion.setAdressVard(ConvertToFKTypes.toVardAdresseringsType(fs.getVardperson())); fkQuestion.setAvsantTidpunkt(fs.getFrageSkickadDatum()); fkQuestion.setFraga(ConvertToFKTypes.toInnehallType(fs.getFrageText(), fs.getFrageSigneringsDatum())); fkQuestion.setLakarutlatande(ConvertToFKTypes.toLakarUtlatande(fs.getIntygsReferens())); fkQuestion.setVardReferensId(fs.getInternReferens().toString()); return fkQuestion; } private  FKQuestionConverter(); static QuestionToFkType convert(FragaSvar fs); }
FKQuestionConverter { public static QuestionToFkType convert(FragaSvar fs) { QuestionToFkType fkQuestion = new QuestionToFkType(); fkQuestion.setAmne(ConvertToFKTypes.toAmneTyp(fs.getAmne())); fkQuestion.setAdressVard(ConvertToFKTypes.toVardAdresseringsType(fs.getVardperson())); fkQuestion.setAvsantTidpunkt(fs.getFrageSkickadDatum()); fkQuestion.setFraga(ConvertToFKTypes.toInnehallType(fs.getFrageText(), fs.getFrageSigneringsDatum())); fkQuestion.setLakarutlatande(ConvertToFKTypes.toLakarUtlatande(fs.getIntygsReferens())); fkQuestion.setVardReferensId(fs.getInternReferens().toString()); return fkQuestion; } private  FKQuestionConverter(); static QuestionToFkType convert(FragaSvar fs);  }