From 0021d3818aa650bf1ccd9463509011e7a736a02a Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Fri, 27 Feb 2015 16:08:27 +0100 Subject: [PATCH] #267 - Polishing. --- .../springframework/hateoas/ResourceSupport.java | 2 +- .../hateoas/ResourceSupportUnitTest.java | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/springframework/hateoas/ResourceSupport.java b/src/main/java/org/springframework/hateoas/ResourceSupport.java index 3879b18a..64de7207 100755 --- a/src/main/java/org/springframework/hateoas/ResourceSupport.java +++ b/src/main/java/org/springframework/hateoas/ResourceSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/hateoas/ResourceSupportUnitTest.java b/src/test/java/org/springframework/hateoas/ResourceSupportUnitTest.java index 3b07a8ff..a30cc72a 100644 --- a/src/test/java/org/springframework/hateoas/ResourceSupportUnitTest.java +++ b/src/test/java/org/springframework/hateoas/ResourceSupportUnitTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -143,4 +143,17 @@ public class ResourceSupportUnitTest { ResourceSupport support = new ResourceSupport(); assertThat(support.equals(null), is(false)); } + + /** + * @see #267 + */ + @Test + public void addsLinksViaVarargs() { + + ResourceSupport support = new ResourceSupport(); + support.add(new Link("/self", "self"), new Link("/another", "another")); + + assertThat(support.hasLink("self"), is(true)); + assertThat(support.hasLink("another"), is(true)); + } }