public class ContainersControllerIntegrationTests extends AbstractControllerIntegrationTest {
@Before
public void before() {
PageRequest pageable = new PageRequest(0, 20);
ContainerAttributes attributes1 = new ContainerAttributes("1").setPid(1234).setHost("host1").setIp("127.0.0.1");
ContainerAttributes attributes2 = new ContainerAttributes("2").setPid(2345).setHost("host2").setIp(
"192.168.2.1");
List<DetailedContainer> containers = new ArrayList<DetailedContainer>();
Container container1 = new Container(attributes1.getId(), attributes1);
Container container2 = new Container(attributes2.getId(), attributes2);
containers.add(new DetailedContainer(container1));
containers.add(new DetailedContainer(container2));
Page<DetailedContainer> pagedEntity = new PageImpl<DetailedContainer>(containers);
when(containerRepository.findAllRuntimeContainers(pageable)).thenReturn(pagedEntity);
when(containerRepository.findOne("1")).thenReturn(container1);