### Question:
SdxConverter { public SharedServiceV4Request getSharedService(SdxClusterResponse sdx) { if (sdx == null) { LOGGER.info("We don't attach the cluster to any Datalake, because the environment has not SDX. So we continue the creation as simple WORKLOAD."); return null; } if (sdx.getStatus() != SdxClusterStatusResponse.RUNNING) { throw new BadRequestException(String.format("Datalake should be running state. Current state is '%s' instead of Running", sdx.getStatus())); } return getSharedServiceV4Request(sdx); }  SharedServiceV4Request getSharedService(SdxClusterResponse sdx); SdxV1Request getSdx(SharedServiceV4Request sharedServiceV4Request); SharedServiceV4Request getSharedServiceV4Request(SdxClusterResponse sdx);  }### Answer:
@Test public void testGetSharedServiceWhenSdxNullAndEnvironmentHasNotSdx() { SharedServiceV4Request sdxRequest = underTest.getSharedService(null); Assertions.assertNull(sdxRequest); }
@Test public void testGetSharedServiceWhenSdxIsRunning() { SdxClusterResponse sdxClusterResponse = new SdxClusterResponse(); sdxClusterResponse.setName("some-sdx"); sdxClusterResponse.setStatus(SdxClusterStatusResponse.RUNNING); SharedServiceV4Request sdxRequest = underTest.getSharedService(sdxClusterResponse); Assertions.assertEquals("some-sdx", sdxRequest.getDatalakeName()); }
@Test public void testGetSharedServiceWhenSdxIsNotRunning() { SdxClusterResponse sdxClusterResponse = new SdxClusterResponse(); sdxClusterResponse.setName("some-sdx"); sdxClusterResponse.setStatusReason("external db creation in progress"); sdxClusterResponse.setStatus(SdxClusterStatusResponse.EXTERNAL_DATABASE_CREATION_IN_PROGRESS); BadRequestException exception = Assertions.assertThrows(BadRequestException.class, () -> underTest.getSharedService(sdxClusterResponse)); Assertions.assertEquals(exception.getMessage(), "Datalake should be running state. Current state is 'EXTERNAL_DATABASE_CREATION_IN_PROGRESS' " + "instead of Running"); }