Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2 from habuma/master

Update dependencies
  • Loading branch information...
commit a6a146010fe584af15b40d08982e6578105e05e5 2 parents 8338783 + d99258b
@habuma habuma authored
View
3  .gitignore
@@ -1,3 +1,6 @@
+.classpath
+.project
+.settings
.DS_Store
build
**/build
View
12 build.gradle
@@ -17,11 +17,11 @@ configure(allprojects) {
sourceCompatibility=1.5
targetCompatibility=1.5
- springSocialVersion = '1.0.2.RELEASE'
- jacksonVersion = '1.9.2'
- junitVersion = '4.8.2'
- mockitoVersion = '1.8.5'
- springVersion = '3.1.0.RELEASE'
+ springSocialVersion = '1.1.0.BUILD-SNAPSHOT'
+ jacksonVersion = '1.9.9'
+ junitVersion = '4.11'
+ mockitoVersion = '1.9.5'
+ springVersion = '3.2.1.RELEASE'
springSecurityVersion = '3.1.0.RELEASE'
[compileJava, compileTestJava]*.options*.compilerArgs = ['-Xlint:none']
@@ -95,7 +95,7 @@ project('spring-social-tripit') {
dependencies {
compile "org.springframework.social:spring-social-core:$springSocialVersion"
compile "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion"
- testCompile "org.springframework.social:spring-social-test:$springSocialVersion"
+ testCompile "org.springframework:spring-test:$springVersion"
}
}
View
20 spring-social-tripit/src/test/java/org/springframework/social/tripit/api/impl/TripItTemplateTest.java
@@ -17,8 +17,8 @@
import static org.junit.Assert.*;
import static org.springframework.http.HttpMethod.*;
-import static org.springframework.social.test.client.RequestMatchers.*;
-import static org.springframework.social.test.client.ResponseCreators.*;
+import static org.springframework.test.web.client.match.MockRestRequestMatchers.*;
+import static org.springframework.test.web.client.response.MockRestResponseCreators.*;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -30,9 +30,9 @@
import org.springframework.core.io.ClassPathResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
-import org.springframework.social.test.client.MockRestServiceServer;
import org.springframework.social.tripit.api.Trip;
import org.springframework.social.tripit.api.TripItProfile;
+import org.springframework.test.web.client.MockRestServiceServer;
/**
* @author Craig Walls
@@ -54,7 +54,7 @@ public void setup() {
@Test
public void getUserProfile_singleEmail() {
mockServer.expect(requestTo("https://api.tripit.com/v1/get/profile?format=json")).andExpect(method(GET))
- .andRespond(withResponse(new ClassPathResource("profile-single-email.json", getClass()), responseHeaders));
+ .andRespond(withSuccess(new ClassPathResource("profile-single-email.json", getClass()), MediaType.APPLICATION_JSON));
TripItProfile profile = tripIt.getUserProfile();
assertEquals("123456", profile.getId());
assertEquals("habuma", profile.getScreenName());
@@ -68,7 +68,7 @@ public void getUserProfile_singleEmail() {
@Test
public void getUserProfile_multiEmails() {
mockServer.expect(requestTo("https://api.tripit.com/v1/get/profile?format=json")).andExpect(method(GET))
- .andRespond(withResponse(new ClassPathResource("profile-multi-emails.json", getClass()), responseHeaders));
+ .andRespond(withSuccess(new ClassPathResource("profile-multi-emails.json", getClass()), MediaType.APPLICATION_JSON));
TripItProfile profile = tripIt.getUserProfile();
assertEquals("123456", profile.getId());
assertEquals("habuma", profile.getScreenName());
@@ -82,14 +82,14 @@ public void getUserProfile_multiEmails() {
@Test
public void getProfileId() {
mockServer.expect(requestTo("https://api.tripit.com/v1/get/profile?format=json")).andExpect(method(GET))
- .andRespond(withResponse(new ClassPathResource("profile-single-email.json", getClass()), responseHeaders));
+ .andRespond(withSuccess(new ClassPathResource("profile-single-email.json", getClass()), MediaType.APPLICATION_JSON));
assertEquals("123456", tripIt.getProfileId());
}
@Test
public void getProfileUrl() {
mockServer.expect(requestTo("https://api.tripit.com/v1/get/profile?format=json")).andExpect(method(GET))
- .andRespond(withResponse(new ClassPathResource("profile-single-email.json", getClass()), responseHeaders));
+ .andRespond(withSuccess(new ClassPathResource("profile-single-email.json", getClass()), MediaType.APPLICATION_JSON));
assertEquals("http://www.tripit.com/user/habuma", tripIt.getProfileUrl());
}
@@ -97,7 +97,7 @@ public void getProfileUrl() {
public void getTrips_manyTrips() {
mockServer.expect(requestTo("https://api.tripit.com/v1/list/trip/traveler/true/past/false?format=json"))
.andExpect(method(GET))
- .andRespond(withResponse(new ClassPathResource("many-trips.json", getClass()), responseHeaders));
+ .andRespond(withSuccess(new ClassPathResource("many-trips.json", getClass()), MediaType.APPLICATION_JSON));
List<Trip> trips = tripIt.getUpcomingTrips();
assertEquals(2, trips.size());
@@ -121,7 +121,7 @@ public void getTrips_manyTrips() {
public void getTrips_oneTrip() {
mockServer.expect(requestTo("https://api.tripit.com/v1/list/trip/traveler/true/past/false?format=json"))
.andExpect(method(GET))
- .andRespond(withResponse(new ClassPathResource("one-trip.json", getClass()), responseHeaders));
+ .andRespond(withSuccess(new ClassPathResource("one-trip.json", getClass()), MediaType.APPLICATION_JSON));
List<Trip> trips = tripIt.getUpcomingTrips();
assertEquals(1, trips.size());
@@ -138,7 +138,7 @@ public void getTrips_oneTrip() {
public void getTrips_noUpcomingTrips() {
mockServer.expect(requestTo("https://api.tripit.com/v1/list/trip/traveler/true/past/false?format=json"))
.andExpect(method(GET))
- .andRespond(withResponse(new ClassPathResource("no-trips.json", getClass()), responseHeaders));
+ .andRespond(withSuccess(new ClassPathResource("no-trips.json", getClass()), MediaType.APPLICATION_JSON));
List<Trip> trips = tripIt.getUpcomingTrips();
assertNotNull(trips);
assertTrue(trips.isEmpty());
Please sign in to comment.
Something went wrong with that request. Please try again.