| Total Complexity | 5 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | package com.base.Http.Server.Responses.ChannelMember; |
||
| 11 | public class GetAllChannelMembersResponse extends BaseResponse { |
||
| 12 | |||
| 13 | public static String VALID_TEAM_SLUG = "twitter"; |
||
| 14 | public static String VALID_CHANNEL_SLUG = "design"; |
||
| 15 | public static int VALID_USER_ID = 0; |
||
| 16 | public static String VALID_USER_NAME = "Sharvil"; |
||
| 17 | |||
| 18 | public GetAllChannelMembersResponse() { |
||
| 19 | super(); |
||
| 20 | } |
||
| 21 | |||
| 22 | public GetAllChannelMembersResponse(String teamSlug, String channelSlug) { |
||
| 23 | super(); |
||
| 24 | VALID_TEAM_SLUG = teamSlug; |
||
| 25 | VALID_CHANNEL_SLUG = channelSlug; |
||
| 26 | } |
||
| 27 | |||
| 28 | @Override |
||
| 29 | public Response getResponse(Request request, Response response) { |
||
| 30 | return response.setStatusCode(200) |
||
| 31 | .setBody(generateResponseBody(getUsers())); |
||
| 32 | } |
||
| 33 | |||
| 34 | private List<User> getUsers() { |
||
| 35 | List<User> users = new ArrayList<>(); |
||
| 36 | |||
| 37 | for (int i = 1; i <= 3; i++) { |
||
| 38 | users.add((User) new User() |
||
| 39 | .setEmail(VALID_USER_NAME + i + "@gmail.com") |
||
| 40 | .setName(VALID_USER_NAME + "i") |
||
| 41 | .setId(VALID_USER_ID + i)); |
||
| 42 | } |
||
| 43 | |||
| 44 | return users; |
||
| 45 | } |
||
| 48 |