Package org.fao.geonet.domain

Examples of org.fao.geonet.domain.MetadataNotification


    @Autowired
    MetadataNotifierRepository _notifierRepo;

    @Test
    public void testFindOne() {
        MetadataNotification notification1 = newMetadataNotification();
        notification1 = _repo.save(notification1);

        MetadataNotification notification2 = newMetadataNotification();
        notification2 = _repo.save(notification2);

        assertEquals(notification2, _repo.findOne(notification2.getId()));
        assertEquals(notification1, _repo.findOne(notification1.getId()));
    }
View Full Code Here


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

    @Test
    public void testFindAllNotNotifiedNotDeleted() {
        MetadataNotification notification1 = newMetadataNotification();
        notification1.setAction(MetadataNotificationAction.UPDATE);
        notification1.setNotified(false);
        notification1 = _repo.save(notification1);

        assertEquals(1, _repo.findAllNotNotifiedForNotifier(notification1.getId().getNotifierId(),
                MetadataNotificationAction.UPDATE).size());

        notification1.setAction(MetadataNotificationAction.DELETE);
        notification1 = _repo.save(notification1);

        assertEquals(0, _repo.findAllNotNotifiedForNotifier(notification1.getId().getNotifierId(),
                MetadataNotificationAction.UPDATE).size());
    }
View Full Code Here

                MetadataNotificationAction.UPDATE).size());
    }

    @Test
    public void testFindAllNotNotifiedNotNotified() {
        MetadataNotification notification1 = newMetadataNotification();
        notification1.setAction(MetadataNotificationAction.UPDATE);
        notification1.setNotified(false);
        notification1 = _repo.save(notification1);

        assertEquals(1, _repo.findAllNotNotifiedForNotifier(notification1.getId().getNotifierId()).size());

        notification1.setNotified(true);
        notification1 = _repo.save(notification1);

        assertEquals(0, _repo.findAllNotNotifiedForNotifier(notification1.getId().getNotifierId()).size());
    }
View Full Code Here

        assertEquals(0, _repo.findAllNotNotifiedForNotifier(notification1.getId().getNotifierId()).size());
    }

    @Test
    public void testFindAllNotNotifiedByNotifierId() {
        MetadataNotification notification1 = newMetadataNotification();
        notification1.setAction(MetadataNotificationAction.UPDATE);
        notification1.setNotified(false);
        notification1 = _repo.save(notification1);

        assertEquals(1, _repo.findAllNotNotifiedForNotifier(notification1.getId().getNotifierId()).size());
        assertEquals(0, _repo.findAllNotNotifiedForNotifier(notification1.getId().getNotifierId() + 1000).size());
    }
View Full Code Here

        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);
        metadataNotification.setMetadataUuid("uuid" + val);
        metadataNotification.setNotified(val % 2 == 0);

        return metadataNotification;
    }
View Full Code Here

TOP

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

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.