Created
September 25, 2016 12:52
-
-
Save dherges/c6e66c3842551b2c3b005ef4711b7377 to your computer and use it in GitHub Desktop.
ok-testing-reloaded-medium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FakeTweetsDb extends TweetsDb { | |
public List<Tweet> fetchTweets(long id, int count) { | |
return IntStream.range(0, 100) | |
.mapToObj((i) -> { | |
final Tweet tweet = new Tweet(); | |
tweet.id = id + i; | |
tweet.text = String.format("Mocked retweet of %s", id); | |
tweet.favorited = false; | |
tweet.user = new User(); | |
tweet.user.name = "Maria Moccachino"; | |
return tweet; | |
}) | |
.collect(Collectors.toList()); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestApplicationContainer | |
extends ProductiveApplicationContainer | |
implements MyTwitterApplicationContainer { | |
@Override | |
public TweetsDb tweetsDb() { | |
return new FakeTweetsDb(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment