From: Aron Roberts Date: Fri, 23 Apr 2010 22:04:42 +0000 (+0000) Subject: CSPACE-901,CSPACE-1577: Apply changes made to other client test classes in CSPACE... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=5abb58980de6d8d3204fd0a926ec9ef3560f3ccb;p=tmp%2Fjakarta-migration.git CSPACE-901,CSPACE-1577: Apply changes made to other client test classes in CSPACE-901 to the recently added PersonAuthRefDocsTest, in the Intake module: declaring and initializing HttpClient-based classes within individual test methods, rather than at the class level. --- diff --git a/services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java b/services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java index 05d2d68d2..2666d6781 100644 --- a/services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java +++ b/services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java @@ -63,8 +63,6 @@ public class PersonAuthRefDocsTest extends BaseServiceTest { LoggerFactory.getLogger(PersonAuthRefDocsTest.class); // Instance variables specific to this test. - private IntakeClient intakeClient = new IntakeClient(); - private PersonAuthorityClient personAuthClient = new PersonAuthorityClient(); final String SERVICE_PATH_COMPONENT = "intakes"; final String PERSON_AUTHORITY_NAME = "TestPersonAuth"; private String knownIntakeId = null; @@ -96,7 +94,8 @@ public class PersonAuthRefDocsTest extends BaseServiceTest { // Create all the person refs and entities createPersonRefs(); - + + IntakeClient intakeClient = new IntakeClient(); MultipartOutput multipart = createIntakeInstance( "entryNumber-" + identifier, "entryDate-" + identifier, @@ -139,6 +138,7 @@ public class PersonAuthRefDocsTest extends BaseServiceTest { } protected void createPersonRefs(){ + PersonAuthorityClient personAuthClient = new PersonAuthorityClient(); String authRefName = PersonAuthorityClientUtils.createPersonAuthRefName(PERSON_AUTHORITY_NAME, false); MultipartOutput multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance( @@ -180,6 +180,7 @@ public class PersonAuthRefDocsTest extends BaseServiceTest { } protected String createPerson(String firstName, String surName, String refName ) { + PersonAuthorityClient personAuthClient = new PersonAuthorityClient(); Map personInfo = new HashMap(); personInfo.put(PersonJAXBSchema.FORE_NAME, firstName); personInfo.put(PersonJAXBSchema.SUR_NAME, surName); @@ -204,7 +205,8 @@ public class PersonAuthRefDocsTest extends BaseServiceTest { testSetup(OK_STATUS, ServiceRequestType.READ,testName); // Get the auth ref docs and check them - ClientResponse refDocListResp = + PersonAuthorityClient personAuthClient = new PersonAuthorityClient(); + ClientResponse refDocListResp = personAuthClient.getReferencingObjects(personAuthCSID, currentOwnerPersonCSID); int statusCode = refDocListResp.getStatus(); @@ -263,6 +265,8 @@ public class PersonAuthRefDocsTest extends BaseServiceTest { } return; } + IntakeClient intakeClient = new IntakeClient(); + PersonAuthorityClient personAuthClient = new PersonAuthorityClient(); if (logger.isDebugEnabled()) { logger.debug("Cleaning up temporary resources created for testing ..."); } @@ -305,7 +309,7 @@ public class PersonAuthRefDocsTest extends BaseServiceTest { MultipartOutput multipart = new MultipartOutput(); OutputPart commonPart = multipart.addPart(intake, MediaType.APPLICATION_XML_TYPE); - commonPart.getHeaders().add("label", intakeClient.getCommonPartName()); + commonPart.getHeaders().add("label", new IntakeClient().getCommonPartName()); if(logger.isDebugEnabled()){ logger.debug("to be created, intake common");