Shipping agent provides origin, destination and arrival deadline. Origin and destination as UN locode [1].
System assigns a unique tracking id. Tracking id should be unique and generated by the system.
Cargo is initially unrouted.
class MeteredCacheTest { | |
Meter gets = new Meter(); | |
Meter puts = new Meter(); | |
Meter hits = new Meter(); | |
MetricRegistry metrics = new MetricRegistry(); | |
Cache delegate = mock<Cache>(); | |
Cache cache = new MeteredCache(delegate, metrics); | |
@Test |
int id = 12345; | |
BigDecimal amount = new BigDecimal(100); | |
Customer customer = new Customer(null, null); | |
@Test | |
void standardInvoice() { | |
when(authenticatedCustomerFinder.apply()).thenReturn(customer); | |
createInvoiceUseCase.create(id, amount); | |
Invoice invoice; | |
@BeforeEach | |
void setup() { | |
createInvoiceToSave(); | |
} | |
@Test | |
void standardInvoice() { | |
mockCustomerFinder(); |
import arrow.fx.IO | |
import arrow.fx.extensions.io.concurrent.concurrent | |
import arrow.fx.extensions.io.concurrent.dispatchers | |
import arrow.fx.fix | |
import kotlin.test.Test | |
fun f1(): IO<String> = IO { | |
"f1 ${Thread.currentThread().name}" | |
} |
import com.github.benmanes.caffeine.cache.CacheLoader | |
import com.github.benmanes.caffeine.cache.Caffeine | |
import com.github.benmanes.caffeine.cache.Ticker | |
import org.assertj.core.api.Assertions.assertThat | |
import org.junit.Test | |
import java.util.concurrent.TimeUnit | |
import java.util.concurrent.atomic.AtomicInteger | |
class CaffeineAsyncRefreshableCacheTest { | |
@Test |
function renderJsonp(res, callback) { | |
res.append('Content-Type', 'application/javascript'); | |
res.send(callback + '(' + JSON.stringify(res.body) + ');'); | |
} | |
function renderJson(res) { | |
res.send(res.body); | |
} | |
function render(req, res) { |