Github user GERey commented on a diff in the pull request:
https://github.com/apache/incubator-usergrid/pull/232#discussion_r28728793
--- Diff:
stack/rest/src/test/java/org/apache/usergrid/rest/filters/ContentTypeResourceIT.java
---
@@ -17,85 +17,55 @@
package org.apache.usergrid.rest.filters;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.usergrid.rest.AbstractRestIT;
-import org.apache.usergrid.rest.TestContextSetup;
+import com.sun.jersey.api.client.ClientResponse;
+import com.sun.jersey.api.client.WebResource;
+import com.sun.jersey.api.representation.Form;
+import org.apache.usergrid.rest.test.resource2point0.AbstractRestIT;
+import org.apache.usergrid.rest.test.resource2point0.model.ApiResponse;
+import org.apache.usergrid.rest.test.resource2point0.model.Entity;
import org.apache.usergrid.utils.JsonUtils;
import org.apache.usergrid.utils.UUIDUtils;
+import org.junit.Ignore;
+import org.junit.Test;
-import org.apache.http.Header;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpHost;
-import org.apache.http.HttpResponse;
-import org.apache.http.NameValuePair;
-import org.apache.http.ParseException;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.message.BasicNameValuePair;
-import org.apache.http.params.BasicHttpParams;
-import org.apache.http.util.EntityUtils;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import java.util.List;
-import static org.junit.Assert.assertEquals;
import static org.apache.usergrid.utils.MapUtils.hashMap;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
-/** @author tnine */
+/**
+ * @author tnine
+ */
// @Ignore("Client login is causing tests to fail due to socket closure by
grizzly. Need to re-enable once we're not
// using grizzly to test")
public class ContentTypeResourceIT extends AbstractRestIT {
- @Rule
- public TestContextSetup context = new TestContextSetup( this );
-
-
/**
* Creates a simple entity of type game. Does not set the content
type. The type should be set to json to match the
* body
*/
@Test
public void correctHeaders() throws Exception {
-
-
- Map<String, String> data = hashMap( "name", "Solitaire1" );
-
- String json = JsonUtils.mapToFormattedJsonString( data );
-
- DefaultHttpClient client = new DefaultHttpClient();
-
- HttpHost host = new HttpHost( super.getBaseURI().getHost(),
super.getBaseURI().getPort() );
-
- HttpPost post = new HttpPost( String.format( "/%s/%s/games",
context.getOrgUuid(), context.getAppUuid() ) );
- post.setEntity( new StringEntity( json ) );
- post.setHeader( HttpHeaders.AUTHORIZATION, "Bearer " +
context.getActiveUser().getToken() );
- post.setHeader( HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON );
- post.setHeader( HttpHeaders.CONTENT_TYPE, "*/*" );
-
- HttpResponse rsp = client.execute( host, post );
-
- printResponse( rsp );
-
- assertEquals( 200, rsp.getStatusLine().getStatusCode() );
-
- Header[] headers = rsp.getHeaders( HttpHeaders.CONTENT_TYPE );
-
- assertEquals( 1, headers.length );
-
- assertEquals( MediaType.APPLICATION_JSON, headers[0].getValue() );
+ refreshIndex();
--- End diff --
Is there a specific reason we want to start by refreshing the index?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---