@Test public void testGetCompositeComponent() { CompositeComponent state1 = new CompositeComponent(); state1.name = "test"; state1.componentLinks = Collections.singletonList("test"); CompositeComponent state2 = new CompositeComponent(); state2.name = "test"; state2.componentLinks = Collections.singletonList("test"); state1 = doPostWithProjectHeader(state1, CompositeComponentFactoryService .SELF_LINK, testProject1.documentSelfLink, CompositeComponent.class); state2 = doPostWithProjectHeader(state2, CompositeComponentFactoryService .SELF_LINK, testProject2.documentSelfLink, CompositeComponent.class); ServiceDocumentQueryResult project1Docs = getDocumentsWithinProject( CompositeComponentFactoryService.SELF_LINK, testProject1.documentSelfLink); assertEquals(1, project1Docs.documentLinks.size()); assertTrue(project1Docs.documentLinks.contains(state1.documentSelfLink)); ServiceDocumentQueryResult project2Docs = getDocumentsWithinProject( CompositeComponentFactoryService.SELF_LINK, testProject2.documentSelfLink); assertEquals(1, project2Docs.documentLinks.size()); assertTrue(project2Docs.documentLinks.contains(state2.documentSelfLink)); }
@Test public void testGetCompositeDescription() { CompositeDescription state1 = new CompositeDescription(); state1.name = "test"; state1.descriptionLinks = Collections.singletonList("test"); CompositeDescription state2 = new CompositeDescription(); state2.name = "test"; state2.descriptionLinks = Collections.singletonList("test"); state1 = doPostWithProjectHeader(state1, CompositeDescriptionFactoryService.SELF_LINK, testProject1.documentSelfLink, CompositeDescription.class); state2 = doPostWithProjectHeader(state2, CompositeDescriptionFactoryService.SELF_LINK, testProject2.documentSelfLink, CompositeDescription.class); ServiceDocumentQueryResult project1Docs = getDocumentsWithinProject( CompositeDescriptionFactoryService.SELF_LINK, testProject1.documentSelfLink); assertEquals(1, project1Docs.documentLinks.size()); assertTrue(project1Docs.documentLinks.contains(state1.documentSelfLink)); ServiceDocumentQueryResult project2Docs = getDocumentsWithinProject( CompositeDescriptionFactoryService.SELF_LINK, testProject2.documentSelfLink); assertEquals(1, project2Docs.documentLinks.size()); assertTrue(project2Docs.documentLinks.contains(state2.documentSelfLink)); }
.documentSelfLink, ClusterDto.class); ServiceDocumentQueryResult project1Docs = getDocumentsWithinProject( ClusterService.SELF_LINK, testProject1.documentSelfLink); assertEquals(1, project1Docs.documentLinks.size()); assertTrue(project1Docs.documentLinks.contains(dto1.documentSelfLink)); ServiceDocumentQueryResult project2Docs = getDocumentsWithinProject( ClusterService.SELF_LINK, testProject2.documentSelfLink); assertEquals(1, project2Docs.documentLinks.size());
@Test public void testGetContainerService() { ContainerState state1 = new ContainerState(); state1.name = "test"; state1.image = "test"; state1 = doPostWithProjectHeader(state1, ContainerFactoryService.SELF_LINK, testProject1.documentSelfLink, ContainerState.class); ContainerState state2 = new ContainerState(); state2.name = "test"; state2.image = "test"; state2 = doPostWithProjectHeader(state2, ContainerFactoryService.SELF_LINK, testProject2.documentSelfLink, ContainerState.class); ServiceDocumentQueryResult project1Docs = getDocumentsWithinProject( ContainerFactoryService.SELF_LINK, testProject1.documentSelfLink); assertEquals(1, project1Docs.documentLinks.size()); assertTrue(project1Docs.documentLinks.contains(state1.documentSelfLink)); ServiceDocumentQueryResult project2Docs = getDocumentsWithinProject( ContainerFactoryService.SELF_LINK, testProject2.documentSelfLink); assertEquals(1, project2Docs.documentLinks.size()); assertTrue(project2Docs.documentLinks.contains(state2.documentSelfLink)); }
@Test public void testGetContainerVolume() { ContainerVolumeState state1 = new ContainerVolumeState(); state1.name = "test"; state1.external = true; ContainerVolumeState state2 = new ContainerVolumeState(); state2.name = "test"; state2.external = true; state1 = doPostWithProjectHeader(state1, ContainerVolumeService .FACTORY_LINK, testProject1.documentSelfLink, ContainerVolumeState.class); state2 = doPostWithProjectHeader(state2, ContainerVolumeService .FACTORY_LINK, testProject2.documentSelfLink, ContainerVolumeState.class); ServiceDocumentQueryResult project1Docs = getDocumentsWithinProject( ContainerVolumeService.FACTORY_LINK, testProject1.documentSelfLink); assertEquals(1, project1Docs.documentLinks.size()); assertTrue(project1Docs.documentLinks.contains(state1.documentSelfLink)); ServiceDocumentQueryResult project2Docs = getDocumentsWithinProject( ContainerVolumeService.FACTORY_LINK, testProject2.documentSelfLink); assertEquals(1, project2Docs.documentLinks.size()); assertTrue(project2Docs.documentLinks.contains(state2.documentSelfLink)); }
@Test public void testGetContainerNetworkDescription() { ContainerNetworkDescription state1 = new ContainerNetworkDescription(); state1.name = "test"; state1.externalName = "test"; state1 = doPostWithProjectHeader(state1, ContainerNetworkDescriptionService.FACTORY_LINK, testProject1.documentSelfLink, ContainerNetworkDescription.class); ContainerNetworkDescription state2 = new ContainerNetworkDescription(); state2.name = "test"; state2.externalName = "test"; state2 = doPostWithProjectHeader(state2, ContainerNetworkDescriptionService.FACTORY_LINK, testProject2.documentSelfLink, ContainerNetworkDescription.class); ServiceDocumentQueryResult project1Docs = getDocumentsWithinProject( ContainerNetworkDescriptionService.FACTORY_LINK, testProject1.documentSelfLink); assertEquals(1, project1Docs.documentLinks.size()); assertTrue(project1Docs.documentLinks.contains(state1.documentSelfLink)); ServiceDocumentQueryResult project2Docs = getDocumentsWithinProject( ContainerNetworkDescriptionService.FACTORY_LINK, testProject2.documentSelfLink); assertEquals(1, project2Docs.documentLinks.size()); assertTrue(project2Docs.documentLinks.contains(state2.documentSelfLink)); }
@Test public void testGetContainerVolumeDescription() { ContainerVolumeDescription state1 = new ContainerVolumeDescription(); state1.name = "test"; state1.externalName = "test"; ContainerVolumeDescription state2 = new ContainerVolumeDescription(); state2.name = "test"; state2.externalName = "test"; state1 = doPostWithProjectHeader(state1, ContainerVolumeDescriptionService.FACTORY_LINK, testProject1.documentSelfLink, ContainerVolumeDescription.class); state2 = doPostWithProjectHeader(state2, ContainerVolumeDescriptionService.FACTORY_LINK, testProject2.documentSelfLink, ContainerVolumeDescription.class); ServiceDocumentQueryResult project1Docs = getDocumentsWithinProject( ContainerVolumeDescriptionService.FACTORY_LINK, testProject1.documentSelfLink); assertEquals(1, project1Docs.documentLinks.size()); assertTrue(project1Docs.documentLinks.contains(state1.documentSelfLink)); ServiceDocumentQueryResult project2Docs = getDocumentsWithinProject( ContainerVolumeDescriptionService.FACTORY_LINK, testProject2.documentSelfLink); assertEquals(1, project2Docs.documentLinks.size()); assertTrue(project2Docs.documentLinks.contains(state2.documentSelfLink)); }
@Test public void testGetContainerDescription() throws Throwable { ContainerDescription desc1 = new ContainerDescription(); desc1.name = "test"; desc1.image = "test"; ContainerDescription desc2 = new ContainerDescription(); desc2.name = "test1"; desc2.image = "test1"; desc1 = doPostWithProjectHeader(desc1, ContainerDescriptionService .FACTORY_LINK, testProject1.documentSelfLink, ContainerDescription.class); assertNotNull(desc1.documentSelfLink); desc2 = doPostWithProjectHeader(desc2, ContainerDescriptionService .FACTORY_LINK, testProject2.documentSelfLink, ContainerDescription.class); assertNotNull(desc2.documentSelfLink); ServiceDocumentQueryResult project1Docs = getDocumentsWithinProject( ContainerDescriptionService.FACTORY_LINK, testProject1.documentSelfLink); assertEquals(1, project1Docs.documentLinks.size()); assertTrue(project1Docs.documentLinks.contains(desc1.documentSelfLink)); ServiceDocumentQueryResult project2Docs = getDocumentsWithinProject( ContainerDescriptionService.FACTORY_LINK, testProject2.documentSelfLink); assertEquals(1, project2Docs.documentLinks.size()); assertTrue(project2Docs.documentLinks.contains(desc2.documentSelfLink)); }
@Test public void testGetContainerNetwork() { ContainerNetworkState state1 = new ContainerNetworkState(); state1.name = "test"; state1.powerState = PowerState.CONNECTED; ContainerNetworkState state2 = new ContainerNetworkState(); state2.name = "test"; state2.powerState = PowerState.CONNECTED; state1 = doPostWithProjectHeader(state1, ContainerNetworkService .FACTORY_LINK, testProject1.documentSelfLink, ContainerNetworkState.class); assertNotNull(state1.documentSelfLink); state2 = doPostWithProjectHeader(state2, ContainerNetworkService .FACTORY_LINK, testProject2.documentSelfLink, ContainerNetworkState.class); assertNotNull(state2.documentSelfLink); ServiceDocumentQueryResult project1Docs = getDocumentsWithinProject( ContainerNetworkService.FACTORY_LINK, testProject1.documentSelfLink); assertEquals(1, project1Docs.documentLinks.size()); assertTrue(project1Docs.documentLinks.contains(state1.documentSelfLink)); ServiceDocumentQueryResult project2Docs = getDocumentsWithinProject( ContainerNetworkService.FACTORY_LINK, testProject2.documentSelfLink); assertEquals(1, project2Docs.documentLinks.size()); assertTrue(project2Docs.documentLinks.contains(state2.documentSelfLink)); }