| Total Complexity | 4 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | package com.base.Http.Server.Responses.Team; |
||
| 8 | public class GetTeamResponse extends BaseResponse { |
||
| 9 | |||
| 10 | public static String VALID_TEAM_SLUG = "twitter"; |
||
| 11 | public static String VALID_NAME = "Twitter"; |
||
| 12 | public static String VALID_DESCRIPTION = "Design Team for Twitter"; |
||
| 13 | public static String VALID_INVITATION_CODE = "Twitter-RD4Uccxjz0ugB2GXa94w"; |
||
| 14 | public static int VALID_ID = 1; |
||
| 15 | |||
| 16 | public GetTeamResponse() { |
||
| 17 | super(); |
||
| 18 | } |
||
| 19 | |||
| 20 | public GetTeamResponse(String teamSlug) { |
||
| 21 | super(); |
||
| 22 | VALID_TEAM_SLUG = teamSlug; |
||
| 23 | } |
||
| 24 | |||
| 25 | @Override |
||
| 26 | public Response getResponse(Request request, Response response) { |
||
| 27 | return response.setStatusCode(200) |
||
| 28 | .setBody(generateResponseBody(getTeam())); |
||
| 29 | } |
||
| 30 | |||
| 31 | public Team getTeam() { |
||
| 32 | return (Team) new Team() |
||
| 33 | .setSlug(VALID_TEAM_SLUG) |
||
| 34 | .setDescription(VALID_DESCRIPTION) |
||
| 35 | .setName(VALID_NAME) |
||
| 36 | .setInvitation_code(VALID_INVITATION_CODE) |
||
| 37 | .setId(VALID_ID); |
||
| 38 | |||
| 42 |