[BAEL-6318] fix test
This commit is contained in:
parent
b61c2af4ac
commit
b6966054b4
|
@ -18,7 +18,7 @@ public class EmployeeClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Page<EmployeeDto> getEmployeeDataFromExternalAPI(Pageable pageable) {
|
public Page<EmployeeDto> getEmployeeDataFromExternalAPI(Pageable pageable) {
|
||||||
String url = "http://localhost:8080/external-service/employee";
|
String url = "http://localhost:8080/employee";
|
||||||
|
|
||||||
UriComponentsBuilder uriBuilder = UriComponentsBuilder.fromUriString(url)
|
UriComponentsBuilder uriBuilder = UriComponentsBuilder.fromUriString(url)
|
||||||
.queryParam("page", pageable.getPageNumber())
|
.queryParam("page", pageable.getPageNumber())
|
||||||
|
|
|
@ -7,6 +7,8 @@ import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.verify;
|
import static org.mockito.Mockito.verify;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.springframework.core.ParameterizedTypeReference;
|
import org.springframework.core.ParameterizedTypeReference;
|
||||||
|
@ -59,7 +61,8 @@ public class EmployeeClientUnitTest {
|
||||||
isNull(),
|
isNull(),
|
||||||
eq(responseType)
|
eq(responseType)
|
||||||
);
|
);
|
||||||
assertEquals(1, result.getNumberOfElements());
|
assertEquals(3, result.getNumberOfElements());
|
||||||
assertEquals(mockedResponse, result.getContent().get(0));
|
List<EmployeeDto> content = result.getContent();
|
||||||
|
assertEquals(mockedResponse.getContent(), content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue