コード例 #1
0
    @Test(expected = ImmutableEntityException.class)
    public void shouldThrowExceptionWhenLoaBalancerNotActive() throws Exception {
      loadBalancerService.setStatus(loadBalancer, LoadBalancerStatus.ERROR);

      LoadBalancer newLoadBalancer = new LoadBalancer();
      newLoadBalancer.setId(loadBalancer.getId());
      newLoadBalancer.setAccountId(loadBalancer.getAccountId());

      newLoadBalancer.addAccessList(accessList);

      accessListService.updateAccessList(newLoadBalancer);
    }
コード例 #2
0
    @Test(expected = BadRequestException.class)
    public void shouldThrowExceptionWhenDuplicateAccessLists() throws Exception {
      LoadBalancer newLoadBalancer = new LoadBalancer();
      newLoadBalancer.setId(loadBalancer.getId());
      newLoadBalancer.setAccountId(loadBalancer.getAccountId());

      accessList.setLoadbalancer(loadBalancer);
      newLoadBalancer.addAccessList(accessList);

      accessListService.updateAccessList(newLoadBalancer);

      loadBalancerService.setStatus(loadBalancer, LoadBalancerStatus.ACTIVE);

      newLoadBalancer.addAccessList(accessList);
      accessListService.updateAccessList(newLoadBalancer);
    }
コード例 #3
0
 private LoadBalancer createLoadBalancerInActiveStatus(LoadBalancer loadBalancer)
     throws Exception {
   LoadBalancer dbLoadBalancer = loadBalancerService.create(loadBalancer);
   loadBalancerService.setStatus(dbLoadBalancer, LoadBalancerStatus.ACTIVE);
   return dbLoadBalancer;
 }