Skip to content

Commit

Permalink
Tests on orcid-persistence working
Browse files Browse the repository at this point in the history
  • Loading branch information
amontenegro committed Jan 19, 2023
1 parent 3515da3 commit 6d3762b
Show file tree
Hide file tree
Showing 44 changed files with 192 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import com.sun.jersey.core.util.MultivaluedMapImpl;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-core-context.xml", "classpath:orcid-oauth2-common-config.xml", "classpath*:orcid-oauth2-api-common-config.xml", "classpath:orcid-persistence-context.xml"})
@ContextConfiguration(locations = { "classpath:orcid-core-context.xml", "classpath:orcid-oauth2-common-config.xml", "classpath*:orcid-oauth2-api-common-config.xml", "classpath:test-orcid-persistence-context.xml"})
public class OrcidClientCredentialEndPointDelegatorTest extends DBUnitTest {

private static final String CLIENT_ID_1 = "APP-5555555555555555";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.springframework.test.context.ContextConfiguration;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class CleanOldClientKeysCronJobTest extends DBUnitTest {

@InjectMocks
Expand Down
1 change: 0 additions & 1 deletion orcid-persistence/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
</parent>

<properties>
<org.orcid.config.file.db.test>classpath:test-db.properties</org.orcid.config.file.db.test>
<main.basedir>${project.parent.basedir}</main.basedir>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
build, but other properties are escaped from Maven build replacement by preceding
with \ and so are handled by Spring. -->
<context:property-placeholder location="\${org.orcid.config.file.db}" ignore-resource-not-found="true" ignore-unresolvable="true" />
<context:property-placeholder location="${org.orcid.config.file.db.test}" ignore-resource-not-found="true" ignore-unresolvable="true" />


<bean id="applicationContextProvder"
class="org.orcid.persistence.spring.ApplicationContextProvider"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
*/
@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class AddressDaoTest extends DBUnitTest {
private static String USER_ORCID = "0000-0000-0000-0003";
private static String OTHER_USER_ORCID = "0000-0000-0000-0001";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
*/
@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class BackupCodesDaoTest extends DBUnitTest {

@Resource(name = "backupCodeDao")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
*/
@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(inheritInitializers = false, inheritLocations = false, locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(inheritInitializers = false, inheritLocations = false, locations = { "classpath:test-orcid-persistence-context.xml" })
public class BiographyDaoTest extends DBUnitTest {
@Resource
BiographyDao biographyDao;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.springframework.test.context.ContextConfiguration;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class ClientDetailsDaoTest extends DBUnitTest {

private static String CLIENT_ID = "APP-5555555555555557";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.springframework.transaction.annotation.Transactional;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class ClientSecretDaoTest extends DBUnitTest {
private static String CLIENT_ID = "APP-5555555555555557";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*
*/
@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class EmailDaoTest extends DBUnitTest {

@Resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.springframework.test.context.ContextConfiguration;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class EmailFrequencyDaoTest extends DBUnitTest {
@Resource(name = "emailFrequencyDao")
EmailFrequencyDao dao;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.springframework.test.context.ContextConfiguration;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class ExternalIdentifierDaoTest extends DBUnitTest {

private static String USER_ORCID = "0000-0000-0000-0003";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.springframework.test.context.ContextConfiguration;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class FindMyStuffDaoTest extends DBUnitTest{
private static String USER_ORCID = "0000-0000-0000-0003";
private static String OTHER_USER_ORCID = "0000-0000-0000-0001";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.springframework.test.context.ContextConfiguration;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@DirtiesContext
public class IdentifierTypeDaoTest extends DBUnitTest{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
*/
@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class InvalidRecordDataChangeDaoTest extends DBUnitTest {

@Resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import org.springframework.transaction.annotation.Transactional;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
@Transactional
public class NotificationDaoTest extends DBUnitTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.springframework.transaction.annotation.Transactional;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
@Transactional
public class NotificationDao_NoDBPrefillTest extends DBUnitTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class OrcidOauth2AuthoriziationCodeDetailDaoTest extends DBUnitTest {

@Resource(name = "orcidOauth2AuthoriziationCodeDetailDao")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.springframework.test.context.ContextConfiguration;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class OrcidOauth2TokenDetailDaoTest extends DBUnitTest {

@Resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.springframework.test.context.ContextConfiguration;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class OrgAffiliationRelationDaoTest extends DBUnitTest {

private static String USER_ORCID = "4444-4444-4444-4443";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.springframework.test.context.ContextConfiguration;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class OrgDisambiguatedDaoTest extends DBUnitTest {

private static final List<String> DATA_FILES = Arrays.asList("/data/SubjectEntityData.xml", "/data/SourceClientDetailsEntityData.xml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.springframework.test.context.ContextConfiguration;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class OrgImportLogDaoTest {

@Resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.springframework.test.context.ContextConfiguration;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class OtherNameDaoTest extends DBUnitTest {

private static String USER_ORCID = "0000-0000-0000-0003";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.springframework.test.context.ContextConfiguration;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class PeerReviewDaoTest extends DBUnitTest {

private static String USER_ORCID = "4444-4444-4444-4446";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.springframework.test.context.ContextConfiguration;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class ProfileFundingDaoTest extends DBUnitTest {

private static String USER_ORCID = "4444-4444-4444-4443";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
*/
@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class ProfileHistoryEventDaoTest extends DBUnitTest {

@Resource(name = "profileHistoryEventDao")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.springframework.test.context.ContextConfiguration;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class ProfileKeywordDaoTest extends DBUnitTest {

private static String USER_ORCID = "0000-0000-0000-0003";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
*/
@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(inheritInitializers = false, inheritLocations = false, locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(inheritInitializers = false, inheritLocations = false, locations = { "classpath:test-orcid-persistence-context.xml" })
public class RecordNameDaoTest extends DBUnitTest {
@Resource
RecordNameDao recordNameDao;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import com.google.common.collect.Lists;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class ResearchResourceDaoTest extends DBUnitTest{

@Resource(name = "researchResourceDao")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.springframework.transaction.annotation.Transactional;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class ResearcherUrlDaoTest extends DBUnitTest {

private static String USER_ORCID = "0000-0000-0000-0003";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.springframework.test.context.ContextConfiguration;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(inheritInitializers = false, inheritLocations = false, locations = {"classpath:orcid-persistence-context.xml"})
@ContextConfiguration(inheritInitializers = false, inheritLocations = false, locations = {"classpath:test-orcid-persistence-context.xml"})
public class SpamDaoTest extends DBUnitTest {

private static String USER_ORCID = "4444-4444-4444-4497";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.springframework.test.context.ContextConfiguration;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class WebhookDaoTest extends DBUnitTest {

@Resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.springframework.test.context.ContextConfiguration;

@RunWith(OrcidJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:orcid-persistence-context.xml" })
@ContextConfiguration(locations = { "classpath:test-orcid-persistence-context.xml" })
public class WorkDaoTest extends DBUnitTest {

private static String USER_ORCID = "4444-4444-4444-4443";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-4.3.xsd">

<context:property-placeholder
location="${org.orcid.config.file.db}"
ignore-resource-not-found="true" />

<context:property-placeholder
location="classpath:/properties/test-db.properties"
ignore-resource-not-found="true"
ignore-unresolvable="true" />

<import resource="classpath*:orcid-persistence-context.xml" />
</beans>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-4.1.xsd">

<import resource="classpath*:orcid-persistence-context.xml" />
<import resource="classpath*:test-orcid-persistence-context.xml" />

<!-- Profile last modified aspect -->
<bean id="profileLastModifiedAspect" class="org.orcid.persistence.aop.ProfileLastModifiedAspect">
Expand Down
2 changes: 1 addition & 1 deletion orcid-test/src/main/java/org/orcid/test/DBUnitTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@Ignore
public class DBUnitTest {

private static final String PERSISTENCE_CONTEXT = "classpath:orcid-persistence-context.xml";
private static final String PERSISTENCE_CONTEXT = "classpath:test-orcid-persistence-context.xml";

private static final String CORE_CONTEXT = "classpath:orcid-core-context.xml";

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Google analytics
org.orcid.core.api.analytics.trackingCode=UA-92988153-2
org.orcid.core.api.analytics.endpoint=https://www.google-analytics.com/collect

# Swagger
org.orcid.swagger.tokenendpoint=https://localhost:8443/orcid-api-web/oauth/token
org.orcid.swagger.authendpoint=https://localhost:8443/orcid-web/oauth/authorize
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Database
org.orcid.persistence.internal_api.db.initialPoolSize=1
org.orcid.persistence.internal_api.db.minPoolSize=1
org.orcid.persistence.internal_api.db.maxPoolSize=3
org.orcid.persistence.internal_api.db.readonly.initialPoolSize=1
org.orcid.persistence.internal_api.db.readonly.minPoolSize=1
org.orcid.persistence.internal_api.db.readonly.maxPoolSize=3
Loading

0 comments on commit 6d3762b

Please sign in to comment.