Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Commit

Permalink
Add tests for the Request interface
Browse files Browse the repository at this point in the history
  • Loading branch information
gilles committed Dec 9, 2015
1 parent 3e15ec2 commit f432e7c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions apollo-api/src/test/java/com/spotify/apollo/RequestTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import java.util.Map;
import java.util.Optional;
import java.util.concurrent.TimeUnit;

import okio.ByteString;

Expand Down Expand Up @@ -139,4 +140,19 @@ public void shouldClearHeaders() throws Exception {
assertThat(requestWithHeader("/foo", "old", "value").clearHeaders().headers(),
is(ImmutableMap.of()));
}

@Test
public void shouldNotHaveTTLByDefault() throws Exception {
assertThat(request("/foo").ttl(), is(Optional.empty()));
}

@Test
public void shouldSetTTL() throws Exception {
assertThat(request("/foo").withTtl(100).ttl().get(), is(100L));
}

@Test
public void shouldSetTTLWithUnit() throws Exception {
assertThat(request("/foo").withTtl(1, TimeUnit.SECONDS).ttl().get(), is(1000L));
}
}

0 comments on commit f432e7c

Please sign in to comment.