// Path: server/user-management/src/main/java/de/budgetfreak/usermanagement/domain/User.java
// @Entity(name = "BF_USER")
// public class User {
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.IDENTITY)
//     @Column(name = "ID")
//     private Long id;
// 
//     @Column(name = "NAME")
//     private String name;
// 
//     @Column(name = "CURRENCY")
//     private String currency;
// 
//     public User() {
//     }
// 
//     public User(String name, String currency) {
//         this.name = name;
//         this.currency = currency;
//     }
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public User setId(Long id) {
//         this.id = id;
//         return this;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public User setName(String name) {
//         this.name = name;
//         return this;
//     }
// 
//     public String getCurrency() {
//         return currency;
//     }
// 
//     public User setCurrency(String currency) {
//         this.currency = currency;
//         return this;
//     }
// }


import static org.assertj.core.api.Assertions.assertThat;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.hateoas.Link;
import org.springframework.test.context.junit4.SpringRunner;
import de.budgetfreak.usermanagement.domain.User;
package de.budgetfreak.usermanagement.web;





@RunWith(SpringRunner.class)
@WebMvcTest(value = UserControllerUserLinks.class)
public class UserControllerUserLinksTest {

    @InjectMocks
    private UserControllerUserLinks testSubject;

    @Test
    public void generateLinks() {
        List<Link> links = new ArrayList<>(testSubject.generateLinks(createUser()));

        assertThat(links.size()).isEqualTo(2);
        assertThat(links.get(0).getRel()).isEqualTo("self");
        assertThat(links.get(0).getHref()).isEqualTo("/users/1");
        assertThat(links.get(1).getRel()).isEqualTo("users");
        assertThat(links.get(1).getHref()).isEqualTo("/users");
    }

// Path: server/user-management/src/main/java/de/budgetfreak/usermanagement/domain/User.java
// @Entity(name = "BF_USER")
// public class User {
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.IDENTITY)
//     @Column(name = "ID")
//     private Long id;
// 
//     @Column(name = "NAME")
//     private String name;
// 
//     @Column(name = "CURRENCY")
//     private String currency;
// 
//     public User() {
//     }
// 
//     public User(String name, String currency) {
//         this.name = name;
//         this.currency = currency;
//     }
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public User setId(Long id) {
//         this.id = id;
//         return this;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public User setName(String name) {
//         this.name = name;
//         return this;
//     }
// 
//     public String getCurrency() {
//         return currency;
//     }
// 
//     public User setCurrency(String currency) {
//         this.currency = currency;
//         return this;
//     }
// }


// Path: server/user-management/src/test/java/de/budgetfreak/usermanagement/web/UserControllerUserLinksTest.java
import static org.assertj.core.api.Assertions.assertThat;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.hateoas.Link;
import org.springframework.test.context.junit4.SpringRunner;
import de.budgetfreak.usermanagement.domain.User;

package de.budgetfreak.usermanagement.web;





@RunWith(SpringRunner.class)
@WebMvcTest(value = UserControllerUserLinks.class)
public class UserControllerUserLinksTest {

    @InjectMocks
    private UserControllerUserLinks testSubject;

    @Test
    public void generateLinks() {
        List<Link> links = new ArrayList<>(testSubject.generateLinks(createUser()));

        assertThat(links.size()).isEqualTo(2);
        assertThat(links.get(0).getRel()).isEqualTo("self");
        assertThat(links.get(0).getHref()).isEqualTo("/users/1");
        assertThat(links.get(1).getRel()).isEqualTo("users");
        assertThat(links.get(1).getHref()).isEqualTo("/users");
    }

    private User createUser() {