@Override protected TopicDto createDto() { return new TopicDto(); }
@Override protected TopicDto newEntity() { TopicDto topic = new TopicDto(); topic.setApplicationId(applicationId); return topic; }
/** * Get all topic data transfer objects. * * @param topicIds the ids of topics * @return <code>List</code> of topics */ public static List<TopicDto> getTopicDtos(List<String> topicIds) { List<TopicDto> topics = Collections.emptyList(); if (topicIds != null && !topicIds.isEmpty()) { topics = new ArrayList<>(topicIds.size()); for (String id : topicIds) { if (id != null) { TopicDto topicDto = new TopicDto(); topicDto.setId(id); topics.add(topicDto); } } } return topics; }
@Test public void testFindByHash() throws Exception { List<TopicDto> topics = new ArrayList<>(); TopicDto topicDto = new TopicDto(); topicDto.setId("6123"); topics.add(topicDto); byte[] hash = "hash".getBytes(); int simpleHash = 123; TopicListEntryDto topicListEntryDto = new TopicListEntryDto(123, hash, topics); topicListEntryDao.save(topicListEntryDto); CassandraTopicListEntry topicListEntry = topicListEntryDao.findByHash(hash); Assert.assertEquals(simpleHash, topicListEntry.getSimpleHash()); } }
protected TopicDto generateTopicDto(String appId, TopicTypeDto type) { TopicDto topic = new TopicDto(); topic.setName(TOPIC_NAME); if (isBlank(appId)) { appId = generateApplicationDto().getId(); } topic.setApplicationId(appId); if (type == null) { type = TopicTypeDto.MANDATORY; } topic.setType(type); return topicService.saveTopic(topic); }
NotificationSchemaDto savedSchema = notificationService.saveNotificationSchema(notificationSchemaDto); TopicDto topicDto = new TopicDto(); topicDto.setApplicationId(app.getId()); topicDto.setName("New Topic");
public ModelAndView createPage(@PathVariable("branchId") Long branchId) { return new ModelAndView("newTopic") .addObject("topicDto", new TopicDto()) .addObject("branchId", branchId);