@Test public void testConfigureClusterWithDl() { Cluster requestedCluster = createBarelyConfiguredRequestedCluster(); DatalakeResources datalakeResources = new DatalakeResources(); when(publicStack.getId()).thenReturn(TEST_LONG_VALUE); when(publicStackCluster.getId()).thenReturn(TEST_LONG_VALUE); when(publicStack.getCluster()).thenReturn(publicStackCluster); when(datalakeResourcesService.findById(anyLong())).thenReturn(Optional.of(datalakeResources)); Cluster result = underTest.configureCluster(requestedCluster, user, workspace); Assert.assertTrue(result.getRdsConfigs().isEmpty()); verify(datalakeResourcesService, times(1)).findById(anyLong()); }
public Cluster configureCluster(@Nonnull Cluster requestedCluster, User user, Workspace workspace) { Objects.requireNonNull(requestedCluster); Stack stack = requestedCluster.getStack(); if (stack.getDatalakeResourceId() != null) { Optional<DatalakeResources> datalakeResources = datalakeResourcesService.findById(stack.getDatalakeResourceId()); if (datalakeResources.isPresent()) { DatalakeResources datalakeResource = datalakeResources.get(); setupRds(requestedCluster, datalakeResource); setupStoragePath(requestedCluster, datalakeResource); } } return requestedCluster; }
SharedServiceConfigProvider { public Cluster configureCluster(@Nonnull Cluster requestedCluster, User user, Workspace workspace) { Objects.requireNonNull(requestedCluster); Stack stack = requestedCluster.getStack(); if (stack.getDatalakeResourceId() != null) { Optional<DatalakeResources> datalakeResources = datalakeResourcesService.findById(stack.getDatalakeResourceId()); if (datalakeResources.isPresent()) { DatalakeResources datalakeResource = datalakeResources.get(); setupRds(requestedCluster, datalakeResource); setupStoragePath(requestedCluster, datalakeResource); } } return requestedCluster; } }
SharedServiceConfigProvider { public Cluster configureCluster(@Nonnull Cluster requestedCluster, User user, Workspace workspace) { Objects.requireNonNull(requestedCluster); Stack stack = requestedCluster.getStack(); if (stack.getDatalakeResourceId() != null) { Optional<DatalakeResources> datalakeResources = datalakeResourcesService.findById(stack.getDatalakeResourceId()); if (datalakeResources.isPresent()) { DatalakeResources datalakeResource = datalakeResources.get(); setupRds(requestedCluster, datalakeResource); setupStoragePath(requestedCluster, datalakeResource); } } return requestedCluster; }  }
SharedServiceConfigProvider { public Cluster configureCluster(@Nonnull Cluster requestedCluster, User user, Workspace workspace) { Objects.requireNonNull(requestedCluster); Stack stack = requestedCluster.getStack(); if (stack.getDatalakeResourceId() != null) { Optional<DatalakeResources> datalakeResources = datalakeResourcesService.findById(stack.getDatalakeResourceId()); if (datalakeResources.isPresent()) { DatalakeResources datalakeResource = datalakeResources.get(); setupRds(requestedCluster, datalakeResource); setupStoragePath(requestedCluster, datalakeResource); } } return requestedCluster; }  Cluster configureCluster(@Nonnull Cluster requestedCluster, User user, Workspace workspace); @Measure(SharedServiceConfigProvider.class) Stack prepareDatalakeConfigs(Stack publicStack); }
SharedServiceConfigProvider { public Cluster configureCluster(@Nonnull Cluster requestedCluster, User user, Workspace workspace) { Objects.requireNonNull(requestedCluster); Stack stack = requestedCluster.getStack(); if (stack.getDatalakeResourceId() != null) { Optional<DatalakeResources> datalakeResources = datalakeResourcesService.findById(stack.getDatalakeResourceId()); if (datalakeResources.isPresent()) { DatalakeResources datalakeResource = datalakeResources.get(); setupRds(requestedCluster, datalakeResource); setupStoragePath(requestedCluster, datalakeResource); } } return requestedCluster; }  Cluster configureCluster(@Nonnull Cluster requestedCluster, User user, Workspace workspace); @Measure(SharedServiceConfigProvider.class) Stack prepareDatalakeConfigs(Stack publicStack);  }