コード例 #1
0
 @Before
 public void setUp() throws CloudbreakSecuritySetupException {
   stack = TestUtil.stack();
   cluster = TestUtil.cluster(TestUtil.blueprint(), stack, 1L);
   stack.setCluster(cluster);
   clusterRequest = new ClusterRequest();
   clusterResponse = new ClusterResponse();
   when(stackService.get(anyLong())).thenReturn(stack);
   when(stackService.getById(anyLong())).thenReturn(stack);
   when(stackService.findLazy(anyLong())).thenReturn(stack);
   when(clusterRepository.save(any(Cluster.class))).thenReturn(cluster);
   given(tlsSecurityService.buildTLSClientConfig(anyLong(), anyString()))
       .willReturn(new TLSClientConfig("", "/tmp"));
 }
コード例 #2
0
  @Test(expected = BadRequestException.class)
  public void testStopWhenAwsHasEphemeralVolume() {
    cluster =
        TestUtil.cluster(
            TestUtil.blueprint(), TestUtil.stack(Status.AVAILABLE, TestUtil.awsCredential()), 1L);
    stack = TestUtil.setEphemeral(cluster.getStack());
    cluster.setStatus(Status.AVAILABLE);
    cluster.setStack(stack);
    stack.setCluster(cluster);

    when(stackService.get(anyLong())).thenReturn(stack);
    when(stackService.getById(anyLong())).thenReturn(stack);

    underTest.updateStatus(1L, StatusRequest.STOPPED);
  }
コード例 #3
0
 @Test(expected = BadRequestException.class)
 public void inValidNetworkRequestReturnFalse() {
   underTest.validateNetworkForStack(
       TestUtil.network("10.0.0.1/32"),
       TestUtil.generateGcpInstanceGroupsByNodeCount(10000, 10000, 10000));
 }
コード例 #4
0
 @Test
 public void validNetworkRequestReturnTrue() {
   assertTrue(
       underTest.validateNetworkForStack(
           TestUtil.network(), TestUtil.generateGcpInstanceGroupsByNodeCount(1, 2, 3)));
 }
 @Override
 public AzureNetwork createSource() {
   return (AzureNetwork) TestUtil.network();
 }