@Test(expected = ServiceException.class) public void testCreateDuplicateApp() { String appId = "someAppId"; App app = new App(); app.setAppId(appId); app.setName("someAppName"); String owner = "someOwnerName"; app.setOwnerName(owner); app.setOwnerEmail("someOwnerName@ctrip.com"); app.setDataChangeCreatedBy(owner); app.setDataChangeLastModifiedBy(owner); app.setDataChangeCreatedTime(new Date()); appRepository.save(app); adminService.createNewApp(app); }
@Transactional public App createNewApp(App app) { String createBy = app.getDataChangeCreatedBy(); App createdApp = appService.save(app); String appId = createdApp.getAppId(); appNamespaceService.createDefaultAppNamespace(appId, createBy); clusterService.createDefaultCluster(appId, createBy); namespaceService.instanceOfAppNamespaces(appId, ConfigConsts.CLUSTER_NAME_DEFAULT, createBy); return app; }
AdminService { @Transactional public App createNewApp(App app) { String createBy = app.getDataChangeCreatedBy(); App createdApp = appService.save(app); String appId = createdApp.getAppId(); appNamespaceService.createDefaultAppNamespace(appId, createBy); clusterService.createDefaultCluster(appId, createBy); namespaceService.instanceOfAppNamespaces(appId, ConfigConsts.CLUSTER_NAME_DEFAULT, createBy); return app; } }
AdminService { @Transactional public App createNewApp(App app) { String createBy = app.getDataChangeCreatedBy(); App createdApp = appService.save(app); String appId = createdApp.getAppId(); appNamespaceService.createDefaultAppNamespace(appId, createBy); clusterService.createDefaultCluster(appId, createBy); namespaceService.instanceOfAppNamespaces(appId, ConfigConsts.CLUSTER_NAME_DEFAULT, createBy); return app; } AdminService(
      final AppService appService,
      final @Lazy AppNamespaceService appNamespaceService,
      final @Lazy ClusterService clusterService,
      final @Lazy NamespaceService namespaceService); }
AdminService { @Transactional public App createNewApp(App app) { String createBy = app.getDataChangeCreatedBy(); App createdApp = appService.save(app); String appId = createdApp.getAppId(); appNamespaceService.createDefaultAppNamespace(appId, createBy); clusterService.createDefaultCluster(appId, createBy); namespaceService.instanceOfAppNamespaces(appId, ConfigConsts.CLUSTER_NAME_DEFAULT, createBy); return app; } AdminService(
      final AppService appService,
      final @Lazy AppNamespaceService appNamespaceService,
      final @Lazy ClusterService clusterService,
      final @Lazy NamespaceService namespaceService); @Transactional App createNewApp(App app); @Transactional void deleteApp(App app, String operator); }
AdminService { @Transactional public App createNewApp(App app) { String createBy = app.getDataChangeCreatedBy(); App createdApp = appService.save(app); String appId = createdApp.getAppId(); appNamespaceService.createDefaultAppNamespace(appId, createBy); clusterService.createDefaultCluster(appId, createBy); namespaceService.instanceOfAppNamespaces(appId, ConfigConsts.CLUSTER_NAME_DEFAULT, createBy); return app; } AdminService(
      final AppService appService,
      final @Lazy AppNamespaceService appNamespaceService,
      final @Lazy ClusterService clusterService,
      final @Lazy NamespaceService namespaceService); @Transactional App createNewApp(App app); @Transactional void deleteApp(App app, String operator);  }