-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Peer review subject types dissertation to dissertation thesis (#7006)
* Deactivated records should get 409 on GET requests * On Peer reviews, the subject type 'DISSERTATION' should be stored as the V3 version 'DISSERTATION_THESIS' * Fix NPE
- Loading branch information
1 parent
293f4f5
commit d3cda46
Showing
3 changed files
with
47 additions
and
0 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
37 changes: 37 additions & 0 deletions
37
...re/src/test/java/org/orcid/core/adapter/converter/PeerReviewSubjectTypeConverterTest.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,37 @@ | ||
package org.orcid.core.adapter.converter; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.orcid.jaxb.model.record_v2.WorkType; | ||
import org.orcid.test.OrcidJUnit4ClassRunner; | ||
import org.springframework.test.context.ContextConfiguration; | ||
|
||
@RunWith(OrcidJUnit4ClassRunner.class) | ||
@ContextConfiguration(locations = { "classpath:test-orcid-core-context.xml" }) | ||
public class PeerReviewSubjectTypeConverterTest { | ||
|
||
private PeerReviewSubjectTypeConverter peerReviewSubjectTypeConverter = new PeerReviewSubjectTypeConverter(); | ||
|
||
@Test | ||
public void testConvertTo() { | ||
for(WorkType t : WorkType.values()) { | ||
assertEquals(t.name(), peerReviewSubjectTypeConverter.convertTo(t, null)); | ||
} | ||
} | ||
|
||
@Test | ||
public void testConvertFrom() { | ||
for(WorkType t : WorkType.values()) { | ||
assertEquals(t, peerReviewSubjectTypeConverter.convertFrom(t.name(), null)); | ||
} | ||
|
||
assertEquals(WorkType.DISSERTATION, peerReviewSubjectTypeConverter.convertFrom(org.orcid.jaxb.model.common.WorkType.DISSERTATION_THESIS.name(), null)); | ||
assertEquals(WorkType.OTHER, peerReviewSubjectTypeConverter.convertFrom(org.orcid.jaxb.model.common.WorkType.ANNOTATION.name(), null)); | ||
assertEquals(WorkType.OTHER, peerReviewSubjectTypeConverter.convertFrom(org.orcid.jaxb.model.common.WorkType.DATA_MANAGEMENT_PLAN.name(), null)); | ||
assertEquals(WorkType.OTHER, peerReviewSubjectTypeConverter.convertFrom(org.orcid.jaxb.model.common.WorkType.PHYSICAL_OBJECT.name(), null)); | ||
assertEquals(WorkType.OTHER, peerReviewSubjectTypeConverter.convertFrom(org.orcid.jaxb.model.common.WorkType.PREPRINT.name(), null)); | ||
assertEquals(WorkType.OTHER, peerReviewSubjectTypeConverter.convertFrom(org.orcid.jaxb.model.common.WorkType.SOFTWARE.name(), null)); | ||
} | ||
} |