Examples of ratingOf()


Examples of org.adoptopenjdk.lambda.tutorial.exercise5.musicplayer.MusicLibrary.ratingOf()

     */
    @Test
    public void overridesDefaultMethodInClassToProvideCustomSongRatingAlgorithm() {
        MusicLibrary library = new CloudScrobblingMusicLibrary();

        assertThat(library.ratingOf(new Song("Candy", "Paulo Nutini")), is(new Rating(78)));
        assertThat(CloudScrobblingMusicLibrary.class, HasConcreteMethod.called("ratingOf"));
    }

    /**
     * Override the default method {@link MusicLibrary#ratingOf(Song)} in {@link UserRatedMusicLibrary} to return
View Full Code Here

Examples of org.adoptopenjdk.lambda.tutorial.exercise5.musicplayer.MusicLibrary.ratingOf()

     */
    @Test
    public void overrideDefaultMethodInInterfaceToProvideUserEnteredSongRatings() {
        MusicLibrary library = new UserRatedLocalFilesystemMusicLibrary();

        assertThat(library.ratingOf(new Song("Desolation Row", "Bob Dylan")), is(new Rating(60)));
        assertThat(UserRatedMusicLibrary.class, HasConcreteMethod.called("ratingOf"));
    }


// Exercises:
View Full Code Here

Examples of org.adoptopenjdk.lambda.tutorial.exercise5.thirdpartyplugin.CloudScrobblingMusicLibrary.ratingOf()

     */
    @Test
    public void overridesDefaultMethodInClassToProvideCustomSongRatingAlgorithm() {
        MusicLibrary library = new CloudScrobblingMusicLibrary();

        assertThat(library.ratingOf(new Song("Candy", "Paulo Nutini")), is(new Rating(78)));
        assertThat(CloudScrobblingMusicLibrary.class, HasConcreteMethod.called("ratingOf"));
    }

    /**
     * Override the default method {@link MusicLibrary#ratingOf(Song)} in {@link UserRatedMusicLibrary} to return
View Full Code Here

Examples of org.adoptopenjdk.lambda.tutorial.exercise5.thirdpartyplugin.UserRatedLocalFilesystemMusicLibrary.ratingOf()

     */
    @Test
    public void overrideDefaultMethodInInterfaceToProvideUserEnteredSongRatings() {
        MusicLibrary library = new UserRatedLocalFilesystemMusicLibrary();

        assertThat(library.ratingOf(new Song("Desolation Row", "Bob Dylan")), is(new Rating(60)));
        assertThat(UserRatedMusicLibrary.class, HasConcreteMethod.called("ratingOf"));
    }


// Exercises:
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.