Merge r1025930 Add test to ensure If-Modified-Since returns 304 if feed is unmodified
git-svn-id: https://svn.apache.org/repos/asf/tuscany/sca-java-1.x/trunk@1027700 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java b/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java
index 7ddc193..c2768be 100644
--- a/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java
+++ b/modules/binding-atom-abdera/src/test/java/org/apache/tuscany/sca/binding/atom/ProviderFeedEntityTagsTestCase.java
@@ -187,13 +187,27 @@
@Test
public void testUnmodifiedGetIfModified() throws Exception {
System.out.println(">>>ProviderFeedEntityTagsTestCase.testFeedUnmodifiedGetIfModified");
+ // Feed request with predicates
+ RequestOptions opts = new RequestOptions();
+ final String contentType = "application/atom+xml";
+ opts.setContentType(contentType);
+ opts.setHeader( "If-Modified-Since", dateFormat.format( new Date() ));
+
+ ClientResponse res = client.get(providerURI, opts);
+ Assert.assertNotNull(res);
+ try {
+ // Should return 304 - Feed not provided since feed is unmodified.
+ Assert.assertEquals(304, res.getStatus());
+ } finally {
+ res.release();
+ }
+
// Feed request with predicates
- RequestOptions opts = new RequestOptions();
- final String contentType = "application/atom+xml";
+ opts = new RequestOptions();
opts.setContentType(contentType);
opts.setHeader( "If-Modified-Since", dateFormat.format( new Date( 0 ) ));
- ClientResponse res = client.get(providerURI, opts);
+ res = client.get(providerURI, opts);
Assert.assertNotNull(res);
try {
// Should return 200 - Feed provided since feed is changed.