Package com.totalchange.jizz.data.entity

Examples of com.totalchange.jizz.data.entity.JizzStation


        verifyAll();
    }

    @Test
    public void testInvalidSongReminderCron() {
        JizzStation mockStation = new JizzStation();
        mockStation.setLocale("EN");
        mockStation.setSongReminderMessageSchedule("Arrrggghhhhhh");

        JizzBroadcast mockBroadcast = new JizzBroadcast();

        mockJizzErrorServices.reportErrorToAdmins(eq(mockStation), eq("The "
                + "cron trigger 'Arrrggghhhhhh' is not valid, can't "
View Full Code Here


        jizzEmailServices = new JizzEmailServicesImpl(mockEmailRenderer);
    }

    @Test
    public void testConfirmEmailAddress() {
        JizzStation mockStation = new JizzStation();
        mockStation.setSmtpServerHost("localhost");
        mockStation.setSmtpServerPort(SMTP_TEST_PORT);
        mockStation.setUrl("http://test.jizz.com/jizz/");

        JizzDj mockDj = new JizzDj();
        mockDj.setStation(mockStation);
        mockDj.setLocale("en");
        mockDj.setName("Test");
        mockDj.setEmail("test@test.com");
        mockDj.setEmailConfirmation("123456");

        JizzEmailResponse mockEmailResponse = new JizzEmailResponse() {
            @Override
            public String getSubject() {
                return "Test Confirmation";
            }

            @Override
            public String getPlainText() {
                return "Test Plain Text Message";
            }

            @Override
            public String getHtml() {
                return "<h1>Test HTML Message</h1>";
            }
        };
        expect(
                mockEmailRenderer.generateConfirmAddressEmail(
                        Locale.forLanguageTag(mockDj.getLocale()),
                        mockStation,
                        mockDj,
                        mockStation.getUrl() + "confirm?key="
                                + mockDj.getEmailConfirmation())).andReturn(
                mockEmailResponse);

        SimpleSmtpServer smtp = SimpleSmtpServer.start(mockStation
                .getSmtpServerPort());
        replay(mockEmailRenderer);
        jizzEmailServices.confirmEmailAddress(mockDj);
        smtp.stop();
        verify(mockEmailRenderer);
View Full Code Here

                mockJizzDjServices, mockJizzEmailServices);
    }

    @Test
    public void testReportErrorToAdmins() {
        JizzStation mockStation = new JizzStation();

        JizzDj admin1 = new JizzDj(), admin2 = new JizzDj(), admin3 = new JizzDj();
        JizzDj dj1 = new JizzDj(), dj2 = new JizzDj(), dj3 = new JizzDj();

        List<JizzDj> djs = new ArrayList<>();
View Full Code Here

                        return encryptedOut;
                    }
                });
        expect(mockBlobStoreWriter.commit()).andReturn("An ID");

        JizzStation mockStation = new JizzStation();
        mockStation.setKey(UUID.randomUUID().toString());

        replayAll();

        JizzBlobWriter writer = jizzBlobServices.createBlob(mockStation);
        InputStream inTest = getTestStream();
View Full Code Here

    @Test
    public void testFindNearestBroadcast() {
        // Also tests insert as will create a few dummy broadcasts to get things
        // going
        JizzStation station = JizzStationJpaDaoTest
                .createDefaultStation(jizzStationDao);

        // One ending in the past (shouldn't be returned)
        JizzBroadcast past = new JizzBroadcast();
        past.setStation(station);
View Full Code Here

public class JizzStationJpaDaoTest {
    @Autowired
    private JizzStationDao jizzStationJpaDao;

    public static JizzStation createDefaultStation(JizzStationDao jizzStationDao) {
        JizzStation station = new JizzStation();
        station.setName("Jizz Test");
        station.setUrl("http://jizz/test");
        station.setBroadcastSchedule("30 17 * * Fri");

        return jizzStationDao.createOrUpdateStation(station);
    }
View Full Code Here

    }

    @Test
    public void testGetPrimaryStation() {
        // Initially should return a blank station (no station exists yet)
        JizzStation station = jizzStationJpaDao.getPrimaryStation();
        assertNull("New install should have no station yet", station);

        // So create a default one
        createDefaultStation(jizzStationJpaDao);
View Full Code Here

    @Test
    public void testCreateOrUpdateStation() {
        createDefaultStation(jizzStationJpaDao);

        JizzStation station = jizzStationJpaDao.getPrimaryStation();
        assertEquals("Jizz Test", station.getName());
        assertEquals("http://jizz/test", station.getUrl());
        assertEquals("30 17 * * Fri", station.getBroadcastSchedule());
    }
View Full Code Here

        }
    }

    @Test
    public void testFindSongById() {
        JizzStation station = JizzStationJpaDaoTest
                .createDefaultStation(jizzStationDao);

        JizzBroadcast broadcast = newBroadcast(station);
        JizzDj dj = newDj(station);
View Full Code Here

        assertEquals(song2.getId(), song.getId());
    }

    @Test
    public void testFindSongsForBroadcast() {
        JizzStation station = JizzStationJpaDaoTest
                .createDefaultStation(jizzStationDao);

        JizzBroadcast broadcast1 = newBroadcast(station);
        JizzBroadcast broadcast2 = newBroadcast(station);
View Full Code Here

TOP

Related Classes of com.totalchange.jizz.data.entity.JizzStation

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.