From de2cc2db73a5de42d9bfaeb92604f28abe2a328a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 24 Oct 2017 17:18:29 +0300 Subject: crosspost: refactoring * spring-social * get tokens via service api --- juick-api/src/test/java/com/juick/api/tests/MessagesTests.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'juick-api/src/test') diff --git a/juick-api/src/test/java/com/juick/api/tests/MessagesTests.java b/juick-api/src/test/java/com/juick/api/tests/MessagesTests.java index b626b0e9..906e8713 100644 --- a/juick-api/src/test/java/com/juick/api/tests/MessagesTests.java +++ b/juick-api/src/test/java/com/juick/api/tests/MessagesTests.java @@ -19,7 +19,7 @@ package com.juick.api.tests; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; -import com.juick.DeviceRegistration; +import com.juick.ExternalToken; import com.juick.Message; import com.juick.Tag; import com.juick.User; @@ -247,7 +247,7 @@ public class MessagesTests extends AbstractJUnit4SpringContextTests { String juickPassword = "demo"; int juickId = userService.createUser(juickName, juickPassword); String token = "123456"; - DeviceRegistration registration = new DeviceRegistration("apns", token); + ExternalToken registration = new ExternalToken(null, "apns", token, null); mockMvc.perform(put("/notifications").with(httpBasic(ugnichName, ugnichPassword)) .contentType(MediaType.APPLICATION_JSON_UTF8) .content(jsonMapper.writeValueAsBytes(Collections.singletonList(registration)))) @@ -260,6 +260,6 @@ public class MessagesTests extends AbstractJUnit4SpringContextTests { List user = jsonMapper.readValue(result.getResponse().getContentAsString(), new TypeReference>() { }); - assertThat(user.get(0).getDevices().get(0).getToken(), equalTo(token)); + assertThat(user.get(0).getTokens().get(0).getToken(), equalTo(token)); } } -- cgit v1.2.3