@Override public LogAppenderDto toDto() { LogAppenderDto dto = super.toDto(); dto.setId(getStringId()); if (application != null) { dto.setApplicationToken(application.getApplicationToken()); dto.setTenantId(application.getTenant().getStringId()); } dto.setMinLogSchemaVersion(minLogSchemaVersion); dto.setMaxLogSchemaVersion(maxLogSchemaVersion); dto.setConfirmDelivery(confirmDelivery); dto.setHeaderStructure(headerStructure != null ? new ArrayList<>(headerStructure) : new ArrayList<>()); return dto; }
@Test public void testFindByApplicationToken() { Tenant ten = generateTenant(); Application app = generateApplication(ten); String token = app.getApplicationToken(); Application found = applicationDao.findByApplicationToken(token); Assert.assertEquals(app, found); }
@Override public SdkProfileDto toDto() { SdkProfileDto dto = this.createDto(); dto.setId(this.getStringId()); dto.setToken(this.token); if (this.application != null) { dto.setApplicationId(this.application.getStringId()); dto.setApplicationToken(this.application.getApplicationToken()); } dto.setName(this.name); dto.setConfigurationSchemaVersion(this.configurationSchemaVersion); dto.setProfileSchemaVersion(this.profileSchemaVersion); dto.setNotificationSchemaVersion(this.notificationSchemaVersion); dto.setLogSchemaVersion(this.logSchemaVersion); if (this.aefMapIds != null) { dto.setAefMapIds(new ArrayList<String>(this.aefMapIds.size())); for (String id : this.aefMapIds) { dto.getAefMapIds().add(id); } } dto.setDefaultVerifierToken(this.defaultVerifierToken); dto.setCreatedUsername(this.createdUsername); dto.setCreatedTime(this.createdTime); dto.setEndpointCount(this.endpointCount); return dto; }
@Test public void testRemoveByApplicationToken() { Tenant ten = generateTenant(); Application app = generateApplication(ten); String token = app.getApplicationToken(); applicationDao.removeByApplicationToken(token); Assert.assertNull(applicationDao.findByApplicationToken(token)); }