### Question:
ClusterProxyService { public void registerGatewayConfiguration(Long stackId) { Stack stack = stackService.getByIdWithListsInTransaction(stackId); if (!stack.getCluster().hasGateway()) { LOGGER.warn("Cluster {} with crn {} in environment {} not configured with Gateway (Knox). Not updating Cluster Proxy with Gateway url.", stack.getCluster().getName(), stack.getResourceCrn(), stack.getEnvironmentCrn()); return; } registerGateway(stack); }  ConfigRegistrationResponse registerCluster(Stack stack); ConfigRegistrationResponse reRegisterCluster(Stack stack); void registerGatewayConfiguration(Long stackId); boolean useClusterProxyForCommunication(Tunnel tunnel, String cloudPlatform); boolean useClusterProxyForCommunication(Stack stack); boolean isCreateConfigForClusterProxy(Stack stack); void deregisterCluster(Stack stack); String getProxyPath(String crn); com.sequenceiq.cloudbreak.api.endpoint.v4.autoscales.response.ClusterProxyConfiguration getClusterProxyConfigurationForAutoscale(); static final String CB_INTERNAL; }### Answer:
@Test public void shouldUpdateKnoxUrlWithClusterProxy() throws ClusterProxyException { when(stackService.getByIdWithListsInTransaction(STACK_ID)).thenReturn(testStackWithKnox()); ConfigUpdateRequest request = configUpdateRequest(STACK_CRN); service.registerGatewayConfiguration(STACK_ID); verify(clusterProxyRegistrationClient).updateConfig(request); }
@Test public void shouldNotUpdateProxyConfigIfClusterIsNotConfiguredWithGateway() throws ClusterProxyException { when(stackService.getByIdWithListsInTransaction(STACK_ID)).thenReturn(testStack()); service.registerGatewayConfiguration(STACK_ID); verify(clusterProxyRegistrationClient, times(0)).updateConfig(any()); }