@Test public void testS3aSchemeIsPassedThroughUnchanged() throws Exception { String cloudPlatform = "aws"; String location = "s3a: Stack placeholderStack = new Stack(); placeholderStack.setCloudPlatform(cloudPlatform); SaltConfig saltConfig = saltConfigGenerator.createSaltConfig(location, BACKUP_ID, RANGER_ADMIN_GROUP, placeholderStack); Map<String, Object> disasterRecoveryProperties = saltConfig.getServicePillarConfig().get("disaster-recovery").getProperties(); Map<String, String> disasterRecoveryKeyValuePairs = (Map<String, String>) disasterRecoveryProperties.get(DISASTER_RECOVERY_KEY); assertEquals(location + "/" + BACKUP_ID + DATABASE_BACKUP_POSTFIX, disasterRecoveryKeyValuePairs.get(OBJECT_STORAGE_URL_KEY)); }
public SaltConfig createSaltConfig(String location, String backupId, String rangerAdminGroup, Stack stack) throws URISyntaxException { String fullLocation = buildFullLocation(location, backupId, stack.getCloudPlatform()); Map<String, SaltPillarProperties> servicePillar = new HashMap<>(); Map<String, String> disasterRecoveryValues = new HashMap<>(); disasterRecoveryValues.put(OBJECT_STORAGE_URL_KEY, fullLocation); disasterRecoveryValues.put(RANGER_ADMIN_GROUP_KEY, rangerAdminGroup); servicePillar.put("disaster-recovery", new SaltPillarProperties(POSTGRESQL_DISASTER_RECOVERY_PILLAR_PATH, singletonMap(DISASTER_RECOVERY_KEY, disasterRecoveryValues))); return new SaltConfig(servicePillar); }
BackupRestoreSaltConfigGenerator { public SaltConfig createSaltConfig(String location, String backupId, String rangerAdminGroup, Stack stack) throws URISyntaxException { String fullLocation = buildFullLocation(location, backupId, stack.getCloudPlatform()); Map<String, SaltPillarProperties> servicePillar = new HashMap<>(); Map<String, String> disasterRecoveryValues = new HashMap<>(); disasterRecoveryValues.put(OBJECT_STORAGE_URL_KEY, fullLocation); disasterRecoveryValues.put(RANGER_ADMIN_GROUP_KEY, rangerAdminGroup); servicePillar.put("disaster-recovery", new SaltPillarProperties(POSTGRESQL_DISASTER_RECOVERY_PILLAR_PATH, singletonMap(DISASTER_RECOVERY_KEY, disasterRecoveryValues))); return new SaltConfig(servicePillar); } }
BackupRestoreSaltConfigGenerator { public SaltConfig createSaltConfig(String location, String backupId, String rangerAdminGroup, Stack stack) throws URISyntaxException { String fullLocation = buildFullLocation(location, backupId, stack.getCloudPlatform()); Map<String, SaltPillarProperties> servicePillar = new HashMap<>(); Map<String, String> disasterRecoveryValues = new HashMap<>(); disasterRecoveryValues.put(OBJECT_STORAGE_URL_KEY, fullLocation); disasterRecoveryValues.put(RANGER_ADMIN_GROUP_KEY, rangerAdminGroup); servicePillar.put("disaster-recovery", new SaltPillarProperties(POSTGRESQL_DISASTER_RECOVERY_PILLAR_PATH, singletonMap(DISASTER_RECOVERY_KEY, disasterRecoveryValues))); return new SaltConfig(servicePillar); }  }
BackupRestoreSaltConfigGenerator { public SaltConfig createSaltConfig(String location, String backupId, String rangerAdminGroup, Stack stack) throws URISyntaxException { String fullLocation = buildFullLocation(location, backupId, stack.getCloudPlatform()); Map<String, SaltPillarProperties> servicePillar = new HashMap<>(); Map<String, String> disasterRecoveryValues = new HashMap<>(); disasterRecoveryValues.put(OBJECT_STORAGE_URL_KEY, fullLocation); disasterRecoveryValues.put(RANGER_ADMIN_GROUP_KEY, rangerAdminGroup); servicePillar.put("disaster-recovery", new SaltPillarProperties(POSTGRESQL_DISASTER_RECOVERY_PILLAR_PATH, singletonMap(DISASTER_RECOVERY_KEY, disasterRecoveryValues))); return new SaltConfig(servicePillar); }  SaltConfig createSaltConfig(String location, String backupId, String rangerAdminGroup, Stack stack); }
BackupRestoreSaltConfigGenerator { public SaltConfig createSaltConfig(String location, String backupId, String rangerAdminGroup, Stack stack) throws URISyntaxException { String fullLocation = buildFullLocation(location, backupId, stack.getCloudPlatform()); Map<String, SaltPillarProperties> servicePillar = new HashMap<>(); Map<String, String> disasterRecoveryValues = new HashMap<>(); disasterRecoveryValues.put(OBJECT_STORAGE_URL_KEY, fullLocation); disasterRecoveryValues.put(RANGER_ADMIN_GROUP_KEY, rangerAdminGroup); servicePillar.put("disaster-recovery", new SaltPillarProperties(POSTGRESQL_DISASTER_RECOVERY_PILLAR_PATH, singletonMap(DISASTER_RECOVERY_KEY, disasterRecoveryValues))); return new SaltConfig(servicePillar); }  SaltConfig createSaltConfig(String location, String backupId, String rangerAdminGroup, Stack stack); static final String POSTGRESQL_DISASTER_RECOVERY_PILLAR_PATH; static final String DISASTER_RECOVERY_KEY; static final String OBJECT_STORAGE_URL_KEY; static final String DATABASE_BACKUP_POSTFIX; static final String RANGER_ADMIN_GROUP_KEY; }