@Override public EndpointGroupDto addTopicsToEndpointGroup(String endpointGroupId, String topicId) throws ControlServiceException { return notifyAndGetPayload(endpointService.addTopicToEndpointGroup(endpointGroupId, topicId)); }
@Test public void testFindTopicsByEndpointGroupId() { ApplicationDto app = generateApplicationDto(); EndpointGroupDto group = generateEndpointGroupDto(app.getId()); TopicDto topic = generateTopicDto(app.getId(), null); endpointService.addTopicToEndpointGroup(group.getId(), topic.getId()); List<TopicDto> found = topicService.findTopicsByEndpointGroupId(group.getId()); Assert.assertEquals(topic, found.get(0)); } }
@Test public void removeTopicByIdAddedToGroupTest() { TopicDto topic = generateTopicDto(null, null); EndpointGroupDto groupDto = generateEndpointGroupDto(topic.getApplicationId()); endpointService.addTopicToEndpointGroup(groupDto.getId(), topic.getId()); topicService.removeTopicById(topic.getId()); TopicDto found = topicService.findTopicById(topic.getId()); Assert.assertNull(found); }