Skip to content

Commit

Permalink
Updates dependencies to current versions
Browse files Browse the repository at this point in the history
  • Loading branch information
gsteinacker committed Jan 30, 2020
1 parent 3807a53 commit 33dca4d
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'maven'
apply plugin: 'jacoco'
apply from: 'dependencies.gradle'

version='2.1.0'
version='2.1.1-SNAPSHOT'
group='de.otto.edison'

repositories {
Expand Down
12 changes: 6 additions & 6 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
ext.libraries = [
test: [
"junit:junit:4.12",
"org.hamcrest:hamcrest-all:1.3",
"org.mockito:mockito-core:2.10.0"],
"junit:junit:4.13",
"org.hamcrest:hamcrest:2.2",
"org.mockito:mockito-core:3.2.4"],
jackson: [
"com.fasterxml.jackson.core:jackson-databind:2.9.6"],
"com.fasterxml.jackson.core:jackson-databind:2.10.0"],
uritemplates: [
"com.damnhandy:handy-uri-templates:2.1.7"],
"com.damnhandy:handy-uri-templates:2.1.8"],
loggingApi: [
"org.slf4j:slf4j-api:1.7.25"],
"org.slf4j:slf4j-api:1.7.30"],
loggingImpl: [
"ch.qos.logback:logback-classic:1.2.3"]
]
52 changes: 26 additions & 26 deletions src/test/java/de/otto/edison/hal/CuriTemplateTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,18 @@
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import java.util.List;
import java.util.Optional;

import static de.otto.edison.hal.CuriTemplate.curiTemplateFor;
import static de.otto.edison.hal.CuriTemplate.matchingCuriTemplateFor;
import static de.otto.edison.hal.Link.curi;
import static de.otto.edison.hal.Link.link;
import static de.otto.edison.hal.Link.linkBuilder;
import static de.otto.edison.hal.Link.*;
import static java.util.Arrays.asList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThrows;

public class CuriTemplateTest {

Expand All @@ -32,28 +29,28 @@ public class CuriTemplateTest {
private final String nonMatchingRel = "http://example.org/link-relations/product";
private final String nonMatchingCuriedRel = "z:product";

@Rule
public ExpectedException expectedEx = ExpectedException.none();

@Test
public void shouldFailToCreateCuriTemplateForWrongRel() {
expectedEx.expect(IllegalArgumentException.class);
expectedEx.expectMessage(matchesRegex(".*not a CURI link.*"));
curiTemplateFor(link("foo", "/bar"));
IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> {
curiTemplateFor(link("foo", "/bar"));
});
assertThat(exception.getMessage(), matchesRegex(".*not a CURI link.*"));
}

@Test
public void shouldFailToCreateCuriTemplateForWrongHref() {
expectedEx.expect(IllegalArgumentException.class);
expectedEx.expectMessage(matchesRegex(".*required.*placeholder.*"));
curiTemplateFor(linkBuilder("curies","/bar").withName("x").build());
IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> {
curiTemplateFor(linkBuilder("curies","/bar").withName("x").build());
});
assertThat(exception.getMessage(), matchesRegex(".*required.*placeholder.*"));
}

@Test
public void shouldFailToCreateCuriTemplateWithMissingName() {
expectedEx.expect(IllegalArgumentException.class);
expectedEx.expectMessage("Parameter is not a CURI link.");
curiTemplateFor(link("curies", "/bar/{rel}"));
IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> {
curiTemplateFor(link("curies", "/bar/{rel}"));
});
assertThat(exception.getMessage(), matchesRegex("Parameter is not a CURI link."));
}

@Test
Expand Down Expand Up @@ -100,9 +97,10 @@ public void shouldExtractCuriedRel() {

@Test
public void shouldFailToExtractCuriedRelForNonMatchingRel() {
expectedEx.expect(IllegalArgumentException.class);
expectedEx.expectMessage("Rel does not match the CURI template.");
curiTemplateFor(someCuri).curiedRelFrom(nonMatchingRel);
IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> {
curiTemplateFor(someCuri).curiedRelFrom(nonMatchingRel);
});
assertThat(exception.getMessage(), matchesRegex("Rel does not match the CURI template."));
}

@Test
Expand All @@ -113,9 +111,10 @@ public void shouldExpandRel() {

@Test
public void shouldFailToExpandNonMatchingRel() {
expectedEx.expect(IllegalArgumentException.class);
expectedEx.expectMessage("Rel does not match the CURI template.");
curiTemplateFor(someCuri).expandedRelFrom(nonMatchingRel);
IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> {
curiTemplateFor(someCuri).expandedRelFrom(nonMatchingRel);
});
assertThat(exception.getMessage(), matchesRegex("Rel does not match the CURI template."));
}

@Test
Expand All @@ -126,9 +125,10 @@ public void shouldExtractPlaceholderValue() {

@Test
public void shouldFailToExtractPlaceholderRelForNonMatchingRel() {
expectedEx.expect(IllegalArgumentException.class);
expectedEx.expectMessage("Rel does not match the CURI template.");
curiTemplateFor(someCuri).relPlaceHolderFrom(nonMatchingRel);
IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, () -> {
curiTemplateFor(someCuri).relPlaceHolderFrom(nonMatchingRel);
});
assertThat(exception.getMessage(), matchesRegex("Rel does not match the CURI template."));
}

private Matcher<String> matchesRegex(final String regex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import static de.otto.edison.hal.paging.PagingRel.*;
import static java.lang.Integer.MAX_VALUE;
import static java.util.EnumSet.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

public class OneBasedNumberedPagingTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import static java.lang.Integer.MAX_VALUE;
import static java.util.EnumSet.*;
import static java.util.OptionalInt.empty;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

public class SkipLimitPagingTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import static de.otto.edison.hal.paging.PagingRel.*;
import static java.lang.Integer.MAX_VALUE;
import static java.util.EnumSet.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

public class ZeroBasedNumberedPagingTest {

Expand Down

0 comments on commit 33dca4d

Please sign in to comment.