@@ -196,17 +196,16 @@ public void testGetBalancingAlgorithmGivenInvalid(){
196196 public void testFindPoolByPort (){
197197 List <PoolV3 > pools = new ArrayList <>();
198198 PoolV3 pool = new PoolV3 ();
199- pool .setIdentifier ("pool_teste" );
200199 pool .setDefaultPort (80 );
201200 pools .add (pool );
202201
203- assertNotNull (_resource .findPoolByPortAndName (80 , pools , "pool_teste" ));
204- assertNull (_resource .findPoolByPortAndName (81 , pools , "pool_teste_2" ));
202+ assertNotNull (_resource .findPoolByPort (80 , pools ));
203+ assertNull (_resource .findPoolByPort (81 , pools ));
205204 }
206205
207206 @ Test
208207 public void testFindPoolByPorGivenNullVip (){
209- assertNull (_resource .findPoolByPortAndName (80 , null , "pool_teste" ));
208+ assertNull (_resource .findPoolByPort (80 , null ));
210209 }
211210
212211 private PoolV3 mockPoolSave (Long poolId , Long idReturned , Boolean hasPoolMember , Integer vipPort , Integer port , String ip , String healthCheckType , String healthCheck , String expectedHealthCheck , int maxConn , String serviceDAction ) throws GloboNetworkException {
@@ -798,7 +797,6 @@ public void testSavePoolAddRealToExistingPool() throws GloboNetworkException {
798797 pool .setDefaultPort (8080 );
799798 pool .setId (12L );
800799 pool .setMaxconn (0 );
801- pool .setIdentifier ("ACS_POOL_region_vip.domain.com_80_8080" );
802800
803801 List <Long > poolIds = Collections .singletonList (pool .getId ());
804802 Ipv4 ip = new Ipv4 ();
@@ -823,18 +821,17 @@ public void testSavePoolAddRealToExistingPool() throws GloboNetworkException {
823821 cmd .setHealthcheckType (build .getHealthCheckType ());
824822 cmd .setExpectedHealthcheck (build .getExpectedHealthCheck ());
825823 cmd .setHealthcheck (build .getHealthCheck ());
826- cmd .setRegion ("region" );
827824
828825 //mock 1 - Pool find by id - v3
829- PoolV3 poolv3GetById = mockPool (12L , "ACS_POOL_region_vip.domain.com_80_8080 " , 8080 , "round-robin" , build .getHealthCheckType (), build .getHealthCheck (), build .getExpectedHealthCheck (), "*" , 5 );
826+ PoolV3 poolv3GetById = mockPool (12L , "ACS_POOL_ " , 8080 , "round-robin" , build .getHealthCheckType (), build .getHealthCheck (), build .getExpectedHealthCheck (), "*" , 5 );
830827 PoolV3 .PoolMember poolM = mockPoolMember (200L , 8080 , 1L , "10.0.0.1" , 1L , "vm-01" );
831828 poolv3GetById .getPoolMembers ().add (poolM );
832829
833830 when (_resource ._globoNetworkApi .getPoolAPI ().getById (12L )).thenReturn (poolv3GetById );
834831 when (_resource ._globoNetworkApi .getPoolAPI ().getByIdsV3 (Collections .singletonList (12L ))).thenReturn (Collections .singletonList (poolv3GetById ));
835832
836833 //mock 2 - Pool save pool
837- PoolV3 poolToSave = mockPool (12L , "ACS_POOL_region_vip.domain.com_80_8080 " , 8080 , "round-robin" , build .getHealthCheckType (), build .getHealthCheck (), build .getExpectedHealthCheck (), "*" , 5 );
834+ PoolV3 poolToSave = mockPool (12L , "ACS_POOL_ " , 8080 , "round-robin" , build .getHealthCheckType (), build .getHealthCheck (), build .getExpectedHealthCheck (), "*" , 5 );
838835 PoolV3 .PoolMember poolMSaved = mockPoolMember (200L , 8080 , 1L , "10.0.0.1" , 1L , "vm-01" );
839836 poolToSave .getPoolMembers ().add (poolMSaved );
840837 PoolV3 .PoolMember poolM2Saved = mockPoolMember (null , 8080 , 2L , "10.0.0.2" , 2L , "vm-02" );
0 commit comments