Sonar: Field should not duplicate name of the class
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
*/
|
||||
package com.omertron.themoviedbapi.model2;
|
||||
|
||||
import com.omertron.themoviedbapi.model2.AbstractJsonMapping;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonRootName;
|
||||
|
||||
@@ -29,18 +28,18 @@ public class Certification extends AbstractJsonMapping {
|
||||
private static final long serialVersionUID = 1L;
|
||||
// Properties
|
||||
@JsonProperty("certification")
|
||||
private String certification;
|
||||
private String value;
|
||||
@JsonProperty("meaning")
|
||||
private String meaning;
|
||||
@JsonProperty("order")
|
||||
private int order;
|
||||
|
||||
public String getCertification() {
|
||||
return certification;
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setCertification(String certification) {
|
||||
this.certification = certification;
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getMeaning() {
|
||||
|
||||
@@ -28,27 +28,24 @@ public class StatusCode extends AbstractJsonMapping {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/*
|
||||
* Properties
|
||||
*/
|
||||
@JsonProperty("status_code")
|
||||
private int statusCode;
|
||||
private int code;
|
||||
@JsonProperty("status_message")
|
||||
private String statusMessage;
|
||||
private String message;
|
||||
|
||||
public int getStatusCode() {
|
||||
return statusCode;
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setStatusCode(int statusCode) {
|
||||
this.statusCode = statusCode;
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getStatusMessage() {
|
||||
return statusMessage;
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setStatusMessage(String statusMessage) {
|
||||
this.statusMessage = statusMessage;
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,22 +147,22 @@ public class TmdbAccountTest extends AbstractTests {
|
||||
// Add a movie as a favourite
|
||||
StatusCode result = instance.modifyFavoriteStatus(getSessionId(), getAccountId(), MediaType.MOVIE, ID_MOVIE_FIGHT_CLUB, true);
|
||||
LOG.info("Result: {}", result);
|
||||
assertTrue("Incorrect status code", result.getStatusCode() == 1 || result.getStatusCode() == 12);
|
||||
assertTrue("Incorrect status code", result.getCode() == 1 || result.getCode() == 12);
|
||||
|
||||
// Remove a movie as a favourite
|
||||
result = instance.modifyFavoriteStatus(getSessionId(), getAccountId(), MediaType.MOVIE, ID_MOVIE_FIGHT_CLUB, false);
|
||||
LOG.info("Result: {}", result);
|
||||
assertTrue("Incorrect status code", result.getStatusCode() == 13);
|
||||
assertTrue("Incorrect status code", result.getCode() == 13);
|
||||
|
||||
// Add a TV Show as a favourite
|
||||
result = instance.modifyFavoriteStatus(getSessionId(), getAccountId(), MediaType.TV, ID_TV_WALKING_DEAD, true);
|
||||
LOG.info("Result: {}", result);
|
||||
assertTrue("Incorrect status code", result.getStatusCode() == 1 || result.getStatusCode() == 12);
|
||||
assertTrue("Incorrect status code", result.getCode() == 1 || result.getCode() == 12);
|
||||
|
||||
// Remove a TV Show as a favourite
|
||||
result = instance.modifyFavoriteStatus(getSessionId(), getAccountId(), MediaType.TV, ID_TV_WALKING_DEAD, false);
|
||||
LOG.info("Result: {}", result);
|
||||
assertTrue("Incorrect status code", result.getStatusCode() == 13);
|
||||
assertTrue("Incorrect status code", result.getCode() == 13);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -238,22 +238,22 @@ public class TmdbAccountTest extends AbstractTests {
|
||||
// Add a movie to the watch list
|
||||
StatusCode result = instance.modifyWatchList(getSessionId(), getAccountId(), MediaType.MOVIE, ID_MOVIE_FIGHT_CLUB, true);
|
||||
LOG.info("Result: {}", result);
|
||||
assertTrue("Incorrect status code", result.getStatusCode() == 1 || result.getStatusCode() == 12);
|
||||
assertTrue("Incorrect status code", result.getCode() == 1 || result.getCode() == 12);
|
||||
|
||||
// Remove a movie from the watch list
|
||||
result = instance.modifyWatchList(getSessionId(), getAccountId(), MediaType.MOVIE, ID_MOVIE_FIGHT_CLUB, false);
|
||||
LOG.info("Result: {}", result);
|
||||
assertTrue("Incorrect status code", result.getStatusCode() == 13);
|
||||
assertTrue("Incorrect status code", result.getCode() == 13);
|
||||
|
||||
// Add a TV Show to the watch list
|
||||
result = instance.modifyWatchList(getSessionId(), getAccountId(), MediaType.TV, ID_TV_WALKING_DEAD, true);
|
||||
LOG.info("Result: {}", result);
|
||||
assertTrue("Incorrect status code", result.getStatusCode() == 1 || result.getStatusCode() == 12);
|
||||
assertTrue("Incorrect status code", result.getCode() == 1 || result.getCode() == 12);
|
||||
|
||||
// Remove a TV Show from the watch list
|
||||
result = instance.modifyWatchList(getSessionId(), getAccountId(), MediaType.TV, ID_TV_WALKING_DEAD, false);
|
||||
LOG.info("Result: {}", result);
|
||||
assertTrue("Incorrect status code", result.getStatusCode() == 13);
|
||||
assertTrue("Incorrect status code", result.getCode() == 13);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -161,7 +161,7 @@ public class TmdbListsTest extends AbstractTests {
|
||||
private void testAddItem(String listId, int mediaId) throws MovieDbException {
|
||||
LOG.info("addItem");
|
||||
StatusCode result = instance.addItem(getSessionId(), listId, mediaId);
|
||||
assertEquals("Invalid response: " + result.toString(), SC_SUCCESS_UPD, result.getStatusCode());
|
||||
assertEquals("Invalid response: " + result.toString(), SC_SUCCESS_UPD, result.getCode());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -172,7 +172,7 @@ public class TmdbListsTest extends AbstractTests {
|
||||
private void testRemoveItem(String listId, int mediaId) throws MovieDbException {
|
||||
LOG.info("removeItem");
|
||||
StatusCode result = instance.removeItem(getSessionId(), listId, mediaId);
|
||||
assertEquals("Invalid response: " + result.toString(), SC_SUCCESS_DEL, result.getStatusCode());
|
||||
assertEquals("Invalid response: " + result.toString(), SC_SUCCESS_DEL, result.getCode());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -183,7 +183,7 @@ public class TmdbListsTest extends AbstractTests {
|
||||
private void testClear(String listId) throws MovieDbException {
|
||||
LOG.info("clear");
|
||||
StatusCode result = instance.clear(getSessionId(), listId, true);
|
||||
assertEquals("Invalid response: " + result.toString(), SC_SUCCESS_UPD, result.getStatusCode());
|
||||
assertEquals("Invalid response: " + result.toString(), SC_SUCCESS_UPD, result.getCode());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -392,7 +392,7 @@ public class TmdbMoviesTest extends AbstractTests {
|
||||
|
||||
for (TestID test : FILM_IDS) {
|
||||
StatusCode result = instance.postMovieRating(test.getTmdb(), rating, getSessionId(), null);
|
||||
assertEquals("failed to post rating", 12, result.getStatusCode());
|
||||
assertEquals("failed to post rating", 12, result.getCode());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user