forked from osopromadze/Spring-Boot-Blog-REST-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestUtils.java
More file actions
43 lines (31 loc) · 908 Bytes
/
TestUtils.java
File metadata and controls
43 lines (31 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.sopromadze.blogapi.utils;
import java.util.Arrays;
import com.sopromadze.blogapi.model.album.Album;
import com.sopromadze.blogapi.model.photo.Photo;
import com.sopromadze.blogapi.model.user.User;
public class TestUtils {
public static Album createAlbum() {
Album album = new Album();
album.setId(Long.valueOf(1));
album.setTitle("album");
album.setUser(createUser());
album.setPhoto(Arrays.asList(TestUtils.createPhoto()));
return album;
}
public static User createUser() {
User user = new User();
user.setId(Long.valueOf(1));
user.setFirstName("admin");
user.setLastName("admin");
user.setEmail("admin@site.com");
user.setUsername("admin");
user.setPassword("password");
user.setWebsite("site.com");
return user;
}
public static Photo createPhoto() {
Photo photo = new Photo();
photo.setId(Long.valueOf(1));
return photo;
}
}