use of com.epam.pipeline.entity.preference.Preference in project cloud-pipeline by epam.
the class AwsRegionManagerTest method createShouldSetPolicyToDefaultValueIfMissing.
@Test
public void createShouldSetPolicyToDefaultValueIfMissing() {
final String defaultPolicyAsString = "{" + "\"key1\":\"value1\"," + "\"key2\":\"value2\"" + "}";
Preference policy = new Preference();
policy.setValue(defaultPolicyAsString);
doReturn(Optional.of(policy)).when(preferenceManager).load(SystemPreferences.DATA_STORAGE_POLICY.getKey());
final AwsRegionVO regionVO = getAwsRegionVoBuilder().corsRules(EMPTY_CORS_RULES).kmsKeyId(KMS_KEY_ID).kmsKeyArn(KMS_KEY_ARN).awsRegionName(VALID_REGION_ID).isDefault(false).build();
awsRegionManager.create(regionVO);
final ArgumentCaptor<AwsRegion> regionCaptor = ArgumentCaptor.forClass(AwsRegion.class);
verify(awsRegionDao).create(regionCaptor.capture());
final AwsRegion actualRegion = regionCaptor.getValue();
assertThat(actualRegion.getPolicy(), is(defaultPolicyAsString));
}
use of com.epam.pipeline.entity.preference.Preference in project cloud-pipeline by epam.
the class PreferenceApiServiceTest method setUp.
@Before
public void setUp() throws Exception {
visiblePreference = new Preference("visible.preference", "", "TEST", "", PreferenceType.STRING, true);
preferenceManager.update(Collections.singletonList(visiblePreference));
}
Aggregations