Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Commit

Permalink
Remove timeToLive from Subscription jms_uri
Browse files Browse the repository at this point in the history
  • Loading branch information
amckenzie committed Mar 12, 2018
1 parent e59cced commit 7269df8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static java.nio.file.Paths.get;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.instanceOf;
Expand All @@ -17,6 +18,7 @@
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import org.everit.json.schema.ValidationException;
Expand All @@ -29,7 +31,7 @@ public class SubscriptionDescriptorFileParserTest {
@Test
public void shouldThrowFileNotFoundException() {
final SubscriptionDescriptorFileParser subscriptionDescriptorFileParser = new SubscriptionDescriptorFileParserFactory().create();
final List<Path> paths = asList(get("no-subscription.yaml"));
final List<Path> paths = singletonList(get("no-subscription.yaml"));
try {
subscriptionDescriptorFileParser.parse(baseDir, paths);
fail();
Expand All @@ -43,7 +45,7 @@ public void shouldThrowFileNotFoundException() {
public void shouldFailOnIncorrectSubscriptionYaml() {
final SubscriptionDescriptorFileParser subscriptionDescriptorFileParser = new SubscriptionDescriptorFileParserFactory().create();

final List<Path> paths = asList(get("incorrect-subscription.yaml"));
final List<Path> paths = singletonList(get("incorrect-subscription.yaml"));
try {
subscriptionDescriptorFileParser.parse(baseDir, paths);
fail();
Expand All @@ -58,7 +60,7 @@ public void shouldFailOnIncorrectSubscriptionYaml() {
public void shouldParsePathsToYaml() {
final SubscriptionDescriptorFileParser subscriptionDescriptorFileParser = new SubscriptionDescriptorFileParserFactory().create();

final List<Path> paths = asList(get("subscription.yaml"));
final List<Path> paths = singletonList(get("subscription.yaml"));
final Collection<SubscriptionDescriptor> subscriptionDescriptors = subscriptionDescriptorFileParser.parse(baseDir, paths);

assertThat(subscriptionDescriptors, hasSize(1));
Expand All @@ -82,15 +84,15 @@ private void assertExampleEventSource(Eventsource eventsource) {
final String name = eventsource.getName();
assertThat(name, is("examplecontext"));
final Location location = eventsource.getLocation();
assertThat(location.getJmsUri(), is("jms:topic:example.event?timeToLive=1000"));
assertThat(location.getJmsUri(), is("jms:topic:example.event"));
assertThat(location.getRestUri(), is("http://localhost:8080/example/event-source-api/rest"));
}

private void assertPeopleEventSource(Eventsource eventsource) {
final String name = eventsource.getName();
assertThat(name, is("people"));
final Location location = eventsource.getLocation();
assertThat(location.getJmsUri(), is("jms:topic:people.event?timeToLive=1000"));
assertThat(location.getJmsUri(), is("jms:topic:people.event"));
assertThat(location.getRestUri(), is("http://localhost:8080/people/event-source-api/rest"));
}

Expand Down Expand Up @@ -118,4 +120,4 @@ private void assertPeopleEvents(Subscription subscription) {
assertThat(events.get(1).getName(), is("people.person-removed"));
assertThat(events.get(1).getSchemaUri(), is("http://justice.gov.uk/json/schemas/domains/people/people.person-removed.json"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ subscription_descriptor:
eventsource:
name: examplecontext
location:
jms_uri: jms:topic:example.event?timeToLive=1000
jms_uri: jms:topic:example.event
rest_uri: http://localhost:8080/example/event-source-api/rest
- name: subscription2
events:
Expand All @@ -24,6 +24,6 @@ subscription_descriptor:
eventsource:
name: people
location:
jms_uri: jms:topic:people.event?timeToLive=1000
jms_uri: jms:topic:people.event
rest_uri: http://localhost:8080/people/event-source-api/rest
...
...
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ subscription_descriptor:
eventsource:
name: examplecontext
location:
jms_uri: jms:topic:example.event?timeToLive=1000
jms_uri: jms:topic:example.event
rest_uri: http://localhost:8080/example/event-source-api/rest
- name: subscription2
events:
Expand All @@ -25,6 +25,6 @@ subscription_descriptor:
eventsource:
name: people
location:
jms_uri: jms:topic:people.event?timeToLive=1000
jms_uri: jms:topic:people.event
rest_uri: http://localhost:8080/people/event-source-api/rest
...
...

0 comments on commit 7269df8

Please sign in to comment.