コード例 #1
0
 @Test
 public void testUpdateDbEntityWithSoapModel() {
   ConfigurationModel dbEntity = modelFactory.getSampleConfigurationModel();
   Configuration soapModel = modelFactory.getSampleConfiguration();
   dozerMapperService.updateDbEntityWithSoapModel(dbEntity, soapModel);
   assertNotNull(dbEntity);
   assertEquals(soapModel.getFps(), dbEntity.getFps());
   assertEquals(soapModel.getLogoColor(), dbEntity.getLogoColor());
   assertEquals(soapModel.getModel(), dbEntity.getModel() == 1 ? Model.LOGO : Model.CAR);
   assertEquals(soapModel.getThreshold(), dbEntity.getThreshold());
   assertEquals(soapModel.isThresholdChecked(), dbEntity.isThresholdChecked());
 }
コード例 #2
0
 @Test
 public void testUpdateDbEntityWithSoapModelNoDbEntity() {
   ConfigurationModel dbEntity = null;
   Configuration soapModel = modelFactory.getSampleConfiguration();
   dozerMapperService.updateDbEntityWithSoapModel(dbEntity, soapModel);
   assertNull(dbEntity);
 }
コード例 #3
0
 @Test
 public void testMapDbEntityToSoapModel() {
   ConfigurationModel dbEntity = modelFactory.getSampleConfigurationModel();
   Configuration soapModel = dozerMapperService.mapDbEntityToSoapModel(dbEntity);
   assertNotNull(soapModel);
   assertEquals(dbEntity.getFps(), soapModel.getFps());
   assertEquals(dbEntity.getLogoColor(), soapModel.getLogoColor());
   assertEquals(dbEntity.getModel() == 1 ? Model.LOGO : Model.CAR, soapModel.getModel());
   assertEquals(dbEntity.getThreshold(), soapModel.getThreshold());
 }