PlanMapper { public Plan convert(PlanEntity plan) { final Plan planItem = new Plan(); planItem.setCharacteristics(plan.getCharacteristics()); planItem.setCommentQuestion(plan.getCommentMessage()); planItem.setCommentRequired(plan.isCommentRequired()); planItem.setDescription(plan.getDescription()); planItem.setId(plan.getId()); planItem.setName(plan.getName()); planItem.setOrder(plan.getOrder()); planItem.setSecurity(SecurityEnum.fromValue(plan.getSecurity().name())); planItem.setValidation(ValidationEnum.fromValue(plan.getValidation().name())); planItem.setGeneralConditions(plan.getGeneralConditions()); return planItem; }  Plan convert(PlanEntity plan);  }
@Test public void testConvertWithSubscriptions() { Plan responsePlan = planMapper.convert(planEntity); assertNotNull(responsePlan); List<String> characteristics = responsePlan.getCharacteristics(); assertNotNull(characteristics); assertEquals(1, characteristics.size()); assertEquals(PLAN_CHARACTERISTIC, characteristics.get(0)); assertEquals(PLAN_COMMENT_MESSAGE, responsePlan.getCommentQuestion()); assertTrue(responsePlan.getCommentRequired()); assertEquals(PLAN_DESCRIPTION, responsePlan.getDescription()); assertEquals(PLAN_ID, responsePlan.getId()); assertEquals(PLAN_NAME, responsePlan.getName()); assertEquals(1, responsePlan.getOrder().intValue()); assertEquals(SecurityEnum.API_KEY, responsePlan.getSecurity()); assertEquals(ValidationEnum.AUTO, responsePlan.getValidation()); }