@Test public void testCheckUserHasRightToTerminateInstanceMethodWhenOwnerAndUserIdIsSameThenNoException() { underTest.checkUserHasRightToTerminateInstance("same", "same", STACK_ID); }
public void checkUserHasRightToTerminateInstance(String owner, String userId, Long stackId) { if (!Objects.equals(owner, userId)) { throw new AccessDeniedException(String.format("Private stack (%s) is only modifiable by the owner.", stackId)); } }
StackDownscaleValidatorService { public void checkUserHasRightToTerminateInstance(String owner, String userId, Long stackId) { if (!Objects.equals(owner, userId)) { throw new AccessDeniedException(String.format("Private stack (%s) is only modifiable by the owner.", stackId)); } } }
StackDownscaleValidatorService { public void checkUserHasRightToTerminateInstance(String owner, String userId, Long stackId) { if (!Objects.equals(owner, userId)) { throw new AccessDeniedException(String.format("Private stack (%s) is only modifiable by the owner.", stackId)); } }  }
StackDownscaleValidatorService { public void checkUserHasRightToTerminateInstance(String owner, String userId, Long stackId) { if (!Objects.equals(owner, userId)) { throw new AccessDeniedException(String.format("Private stack (%s) is only modifiable by the owner.", stackId)); } }  void checkInstanceIsTheClusterManagerServerOrNot(String instancePublicIp, InstanceMetadataType metadataType); void checkUserHasRightToTerminateInstance(String owner, String userId, Long stackId); void checkClusterInValidStatus(Cluster cluster); }
StackDownscaleValidatorService { public void checkUserHasRightToTerminateInstance(String owner, String userId, Long stackId) { if (!Objects.equals(owner, userId)) { throw new AccessDeniedException(String.format("Private stack (%s) is only modifiable by the owner.", stackId)); } }  void checkInstanceIsTheClusterManagerServerOrNot(String instancePublicIp, InstanceMetadataType metadataType); void checkUserHasRightToTerminateInstance(String owner, String userId, Long stackId); void checkClusterInValidStatus(Cluster cluster);  }