Package org.fao.geonet.domain

Examples of org.fao.geonet.domain.MetadataNotifier


    private MetadataNotification newMetadataNotification() {
        return newMetadataNotification(_inc, _notifierRepo);
    }
    public static MetadataNotification newMetadataNotification(AtomicInteger inc, MetadataNotifierRepository notifierRepo) {

        MetadataNotifier notifier = MetadataNotifierRepositoryTest.newMetadataNotifier(inc);
        notifier = notifierRepo.save(notifier);

        int val = inc.incrementAndGet();
        MetadataNotification metadataNotification = new MetadataNotification();

        MetadataNotificationId mdNotId = new MetadataNotificationId();
        mdNotId.setMetadataId(val);
        mdNotId.setNotifierId(notifier.getId());

        metadataNotification.setId(mdNotId);
        metadataNotification.setAction(val % 2 == 0 ? MetadataNotificationAction.UPDATE : MetadataNotificationAction.DELETE);

        metadataNotification.setErrorMessage("errorMessage" + val);
View Full Code Here


        }
        final MetadataNotificationRepository notificationRepository = context.getBean(MetadataNotificationRepository.class);
        final MetadataNotifierRepository notifierRepository = context.getBean(MetadataNotifierRepository.class);

        for(NotificationTarget notificationTarget : notificationTargets.values()) {
            final MetadataNotifier metadataNotifier = new MetadataNotifier();
            metadataNotifier.setName(notificationTarget.getName());
            metadataNotifier.setUsername(notificationTarget.getUsername());
            metadataNotifier.setPassword(notificationTarget.getPassword());
            metadataNotifier.setUrl(notificationTarget.getUrl());
            metadataNotifier.setEnabled(notificationTarget.isEnabled());

            // insert
            if (!notificationTarget.isPreExisting() && StringUtils.isNotBlank(notificationTarget.getName())
                    && StringUtils.isNotBlank(notificationTarget.getUrl())) {
View Full Code Here

    @Autowired
    MetadataNotifierRepository _repo;

    @Test
    public void testFindOne() {
        MetadataNotifier notifier1 = newMetadataNotifier();
        notifier1 = _repo.save(notifier1);

        MetadataNotifier notifier2 = newMetadataNotifier();
        notifier2 = _repo.save(notifier2);

        assertEquals(notifier2, _repo.findOne(notifier2.getId()));
        assertEquals(notifier1, _repo.findOne(notifier1.getId()));
    }
View Full Code Here

        assertEquals(notifier1, _repo.findOne(notifier1.getId()));
    }

    @Test
    public void testFindAllByEnabled() {
        MetadataNotifier notifier1 = newMetadataNotifier();
        notifier1 = _repo.save(notifier1);

        MetadataNotifier notifier2 = newMetadataNotifier();
        notifier2 = _repo.save(notifier2);

        List<MetadataNotifier> metadataCategory = _repo.findAllByEnabled(notifier1.isEnabled());
        assertEquals(notifier1.getName(), metadataCategory.get(0).getName());

        metadataCategory = _repo.findAllByEnabled(notifier2.isEnabled());
        assertEquals(notifier2.getName(), metadataCategory.get(0).getName());
    }
View Full Code Here

        return newMetadataNotifier(inc);
    }

    public static MetadataNotifier newMetadataNotifier(AtomicInteger inc) {
        int val = inc.incrementAndGet();
        MetadataNotifier metadataCategory = new MetadataNotifier();
        metadataCategory.setName("name" + val);
        metadataCategory.setPassword("password" + val);
        metadataCategory.setUrl("url" + val);
        metadataCategory.setUsername("username" + val);
        metadataCategory.setEnabled(val % 2 == 0);

        return metadataCategory;
    }
View Full Code Here

TOP

Related Classes of org.fao.geonet.domain.MetadataNotifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.