@Test public void testShouldUseBaseCMImageWithProductsAndCmRepoAndPlatformIsYarn() { ClusterV4Request clusterV4Request = new ClusterV4Request(); ClouderaManagerV4Request cmRequest = new ClouderaManagerV4Request(); ClouderaManagerProductV4Request cdpRequest = new ClouderaManagerProductV4Request(); cdpRequest.setName("CDP"); cdpRequest.setParcel("parcel"); cdpRequest.setVersion("version"); cdpRequest.setCsd(List.of("csd")); cmRequest.setProducts(List.of(cdpRequest)); ClouderaManagerRepositoryV4Request cmRepoRequest = new ClouderaManagerRepositoryV4Request(); cmRequest.setRepository(cmRepoRequest); clusterV4Request.setCm(cmRequest); boolean base = underTest.shouldUseBaseCMImage(clusterV4Request, YARN_PLATFORM); assertTrue(base); }
boolean shouldUseBaseCMImage(ClusterV4Request clusterRequest, String platformString) { ClouderaManagerV4Request cmRequest = clusterRequest.getCm(); return hasCmParcelInfo(cmRequest) || CloudPlatform.YARN.equalsIgnoreCase(platformString); }
StackCreatorService { boolean shouldUseBaseCMImage(ClusterV4Request clusterRequest, String platformString) { ClouderaManagerV4Request cmRequest = clusterRequest.getCm(); return hasCmParcelInfo(cmRequest) || CloudPlatform.YARN.equalsIgnoreCase(platformString); } }
StackCreatorService { boolean shouldUseBaseCMImage(ClusterV4Request clusterRequest, String platformString) { ClouderaManagerV4Request cmRequest = clusterRequest.getCm(); return hasCmParcelInfo(cmRequest) || CloudPlatform.YARN.equalsIgnoreCase(platformString); }  }
StackCreatorService { boolean shouldUseBaseCMImage(ClusterV4Request clusterRequest, String platformString) { ClouderaManagerV4Request cmRequest = clusterRequest.getCm(); return hasCmParcelInfo(cmRequest) || CloudPlatform.YARN.equalsIgnoreCase(platformString); }  StackV4Response createStack(User user, Workspace workspace, StackV4Request stackRequest, boolean distroxRequest); }
StackCreatorService { boolean shouldUseBaseCMImage(ClusterV4Request clusterRequest, String platformString) { ClouderaManagerV4Request cmRequest = clusterRequest.getCm(); return hasCmParcelInfo(cmRequest) || CloudPlatform.YARN.equalsIgnoreCase(platformString); }  StackV4Response createStack(User user, Workspace workspace, StackV4Request stackRequest, boolean distroxRequest);  }