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
class DoItAllService extends nl.grons.sentries.support.SentrySupport { | |
val dbSentry = sentry("mysql:localhost:3366") withMetrics withFailLimit(failLimit = 5, retryDelay = 500 millis) | |
val twitterApiSentry = sentry("twitter") withMetrics withFailLimit(failLimit = 5, retryDelay = 500 millis) withConcurrencyLimit(3) | |
def loadTweetFromDb(id: Long): Tweet = dbSentry { | |
database.load(id) | |
} | |
def getFromTwitter(id: Long): Tweet = twitterApiSentry { |
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
import org.specs2.mutable._ | |
import org.specs2.mock._ | |
import org.specs2.specification.Scope | |
class ParentElementStrategyTest extends SpecificationWithJUnit with Mockito { | |
"The ParentElementStrategy" should { | |
"extract a user ref" in new SimpleContext { | |
val testColumn = mock[Column] | |
registry.get("urn:grons.nl:user:9475877") returns testColumn | |
userStrategy("user").getShardForEntity(ad, columns) must beTheSameAs(testColumn) |
NewerOlder