Skip to content

Commit b7dbb40

Browse files
author
Gopinath Langote
committed
iluwatar#631 - Partial Response : [Refactor] Modify video model fields.
1 parent 87d4853 commit b7dbb40

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

partial-response/src/main/java/com/iluwatar/partialresponse/Video.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,26 @@
3131
public class Video {
3232
private String id;
3333
private String title;
34-
private Long length;
34+
private Integer length;
3535
private String description;
36-
private String publisher;
37-
private String status;
36+
private String director;
37+
private String language;
3838

3939
/**
4040
* @param id video unique id
4141
* @param title video title
42-
* @param length video length in seconds
42+
* @param length video length in minutes
4343
* @param description video description by publisher
44-
* @param publisher video publisher name
45-
* @param status video status {private, public}
44+
* @param director video director name
45+
* @param language video language {private, public}
4646
*/
47-
public Video(String id, String title, Long length, String description, String publisher, String status) {
47+
public Video(String id, String title, Integer length, String description, String director, String language) {
4848
this.id = id;
4949
this.title = title;
5050
this.length = length;
5151
this.description = description;
52-
this.publisher = publisher;
53-
this.status = status;
52+
this.director = director;
53+
this.language = language;
5454
}
5555

5656
@Override
@@ -60,8 +60,8 @@ public String toString() {
6060
", title='" + title + '\'' +
6161
", length=" + length +
6262
", description='" + description + '\'' +
63-
", publisher='" + publisher + '\'' +
64-
", status='" + status + '\'' +
63+
", director='" + director + '\'' +
64+
", language='" + language + '\'' +
6565
'}';
6666
}
6767
}

partial-response/src/test/java/com/iluwatar/partialresponse/VideoResourceTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ public class VideoResourceTest {
3636
@Before
3737
public void setUp() {
3838
Map<String, Video> videos = new HashMap<>();
39-
videos.put("1", new Video("1", "title 1", 100L, "", "", ""));
40-
videos.put("1", new Video("2", "title 2", 100L, "", "", ""));
41-
videos.put("1", new Video("3", "title 3", 100L, "", "", ""));
39+
videos.put("1", new Video("1", "Avatar", 178, "epic science fiction film", "James Cameron", "English"));
40+
videos.put("1", new Video("2", "Godzilla Resurgence", 120, "Action & drama movie|", "Hideaki Anno", "Japanese"));
41+
videos.put("1", new Video("3", "Interstellar", 169, "Adventure & Sci-Fi", "Christopher Nolan", "English"));
4242
resource = new VideoResource(videos);
4343
}
4444

0 commit comments

Comments
 (0)