use of org.openkilda.persistence.repositories.KildaFeatureTogglesRepository in project open-kilda by telstra.
the class AbstractYFlowTest method alterFeatureToggles.
protected void alterFeatureToggles(Boolean isCreateAllowed, Boolean isUpdateAllowed, Boolean isDeleteAllowed, Boolean isModifyYFlowEnabled) {
KildaFeatureTogglesRepository repository = persistenceManager.getRepositoryFactory().createFeatureTogglesRepository();
KildaFeatureToggles toggles = repository.find().orElseGet(() -> {
KildaFeatureToggles newToggles = KildaFeatureToggles.builder().build();
repository.add(newToggles);
return newToggles;
});
if (isCreateAllowed != null) {
toggles.setCreateFlowEnabled(isCreateAllowed);
}
if (isUpdateAllowed != null) {
toggles.setUpdateFlowEnabled(isUpdateAllowed);
}
if (isDeleteAllowed != null) {
toggles.setDeleteFlowEnabled(isDeleteAllowed);
}
if (isModifyYFlowEnabled != null) {
toggles.setModifyYFlowEnabled(isModifyYFlowEnabled);
}
}
use of org.openkilda.persistence.repositories.KildaFeatureTogglesRepository in project open-kilda by telstra.
the class AbstractFlowTest method alterFeatureToggles.
protected void alterFeatureToggles(Boolean isCreateAllowed, Boolean isUpdateAllowed, Boolean isDeleteAllowed) {
KildaFeatureTogglesRepository repository = persistenceManager.getRepositoryFactory().createFeatureTogglesRepository();
KildaFeatureToggles toggles = repository.find().orElseGet(() -> {
KildaFeatureToggles newToggles = KildaFeatureToggles.builder().build();
repository.add(newToggles);
return newToggles;
});
if (isCreateAllowed != null) {
toggles.setCreateFlowEnabled(isCreateAllowed);
}
if (isUpdateAllowed != null) {
toggles.setUpdateFlowEnabled(isUpdateAllowed);
}
if (isDeleteAllowed != null) {
toggles.setDeleteFlowEnabled(isDeleteAllowed);
}
}
Aggregations