-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/MET-6002 Save record deletion reason (#676)
* MET-6002 Created enum to save depublish reason Started to save the reason in depublish plugin * MET-6002 Included depublication reason into depublish * MET-6002 Readjusted code for depublication reason. Created new API call to get all possible depublication reasons * MET-6002 Updated existing API calls * MET-6002 Added depublication reason field for DepublishRecordIdView * MET-6002 Added the parameter depublication reason when schedueling a depublication workflow * MET-6002 code review comments and unit test --------- Co-authored-by: Jorge Ortiz <[email protected]>
- Loading branch information
1 parent
908433b
commit c7823a1
Showing
13 changed files
with
183 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...re-common/src/main/java/eu/europeana/metis/core/workflow/plugins/DepublicationReason.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package eu.europeana.metis.core.workflow.plugins; | ||
|
||
public enum DepublicationReason { | ||
|
||
BROKEN_MEDIA_LINKS("Broken media links"), | ||
GDPR("GDPR"), | ||
LACK_OF_PERMISSIONS("Lack of permissions"), | ||
SENSITIVE_CONTENT("Sensitive content"), | ||
REMOVED_DATA_AT_SOURCE("Removed data at source"), | ||
GENERIC("Generic"), | ||
UNKNOWN("Unknown"); | ||
|
||
private final String valueAsString; | ||
|
||
DepublicationReason(String valueAsString) { | ||
this.valueAsString = valueAsString; | ||
} | ||
|
||
public String toString(){ | ||
return valueAsString; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...n/src/test/java/eu/europeana/metis/core/workflow/plugins/DepublishPluginMetadataTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package eu.europeana.metis.core.workflow.plugins; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import java.util.Set; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.EnumSource; | ||
|
||
class DepublishPluginMetadataTest { | ||
|
||
DepublishPluginMetadata depublishPluginMetadata = new DepublishPluginMetadata(); | ||
|
||
@Test | ||
void getExecutablePluginType() { | ||
assertEquals(ExecutablePluginType.DEPUBLISH, depublishPluginMetadata.getExecutablePluginType()); | ||
} | ||
|
||
@Test | ||
void isDatasetDepublish() { | ||
final boolean datasetDepublish = true; | ||
depublishPluginMetadata.setDatasetDepublish(datasetDepublish); | ||
boolean actualDepublish = depublishPluginMetadata.isDatasetDepublish(); | ||
assertEquals(datasetDepublish, actualDepublish); | ||
} | ||
|
||
@Test | ||
void getRecordIdsToDepublish() { | ||
Set<String> recordIdsToDepublish = Set.of("t1r", "t2r", "t3r", "t4r", "t5r"); | ||
depublishPluginMetadata.setRecordIdsToDepublish(recordIdsToDepublish); | ||
Set<String> actualDepublish = depublishPluginMetadata.getRecordIdsToDepublish(); | ||
assertEquals(recordIdsToDepublish, actualDepublish); | ||
} | ||
|
||
@ParameterizedTest | ||
@EnumSource(DepublicationReason.class) | ||
void getDepublicationReason(DepublicationReason depublicationReason) { | ||
|
||
depublishPluginMetadata.setDepublicationReason(depublicationReason); | ||
|
||
assertEquals(depublicationReason, depublishPluginMetadata.getDepublicationReason()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.