]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
Correct identification number field name (#297)
authorMichael Ritter <mikejritter@users.noreply.github.com>
Fri, 17 Jun 2022 00:17:16 +0000 (18:17 -0600)
committerGitHub <noreply@github.com>
Fri, 17 Jun 2022 00:17:16 +0000 (20:17 -0400)
services/iterationreport/client/src/test/java/org/collectionspace/services/client/test/IterationreportServiceTest.java
services/iterationreport/jaxb/src/main/resources/iterationreports_common.xsd

index 0730147d5e2955da2fae91221a063791711902a4..3ff0e8fb3a398f3dbc59584eaf6f75954d541c78 100644 (file)
@@ -41,11 +41,6 @@ public class IterationreportServiceTest extends AbstractPoxServiceTestImpl<Abstr
     /** The logger. */
     private final String CLASS_NAME = IterationreportServiceTest.class.getName();
     private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
-    // Instance variables specific to this test.
-    /** The service path component. */
-    final String SERVICE_NAME = "transports";
-    final String SERVICE_PATH_COMPONENT = "transports";
-
 
     /* (non-Javadoc)
      * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
@@ -158,11 +153,12 @@ public class IterationreportServiceTest extends AbstractPoxServiceTestImpl<Abstr
 
         // Get the common part of the response and verify that it is not null.
         PayloadInputPart payloadInputPart = input.getPart(client.getCommonPartName());
-        IterationreportsCommon transportCommon = null;
+        IterationreportsCommon iterationreportCommon = null;
         if (payloadInputPart != null) {
-            transportCommon = (IterationreportsCommon) payloadInputPart.getBody();
+            iterationreportCommon = (IterationreportsCommon) payloadInputPart.getBody();
         }
-        Assert.assertNotNull(transportCommon);
+        Assert.assertNotNull(iterationreportCommon);
+        Assert.assertNotNull(iterationreportCommon.getIterationIdentificationNumber());
     }
 
     // Failure outcomes
@@ -283,18 +279,18 @@ public class IterationreportServiceTest extends AbstractPoxServiceTestImpl<Abstr
 
         // Extract the common part from the response.
         PayloadInputPart payloadInputPart = input.getPart(client.getCommonPartName());
-        IterationreportsCommon transportCommon = null;
+        IterationreportsCommon iterationreportCommon = null;
         if (payloadInputPart != null) {
-            transportCommon = (IterationreportsCommon) payloadInputPart.getBody();
+            iterationreportCommon = (IterationreportsCommon) payloadInputPart.getBody();
         }
-        Assert.assertNotNull(transportCommon);
+        Assert.assertNotNull(iterationreportCommon);
 
         // Update the content of this resource.
-        transportCommon.setIterationreportReferenceNumber("updated-" + transportCommon.getIterationreportReferenceNumber());
+        iterationreportCommon.setIterationIdentificationNumber("updated-" + iterationreportCommon.getIterationIdentificationNumber());
 
         if (logger.isDebugEnabled()) {
             logger.debug("to be updated object");
-            logger.debug(objectAsXmlString(transportCommon, IterationreportsCommon.class));
+            logger.debug(objectAsXmlString(iterationreportCommon, IterationreportsCommon.class));
         }
 
         setupUpdate();
@@ -302,7 +298,7 @@ public class IterationreportServiceTest extends AbstractPoxServiceTestImpl<Abstr
         // Submit the updated common part in an update request to the service
         // and store the response.
         PoxPayloadOut output = new PoxPayloadOut(this.getServicePathComponent());
-        PayloadOutputPart commonPart = output.addPart(client.getCommonPartName(), transportCommon);
+        PayloadOutputPart commonPart = output.addPart(client.getCommonPartName(), iterationreportCommon);
         res = client.update(knownResourceId, output);
         try {
             assertStatusCode(res, testName);
@@ -330,8 +326,8 @@ public class IterationreportServiceTest extends AbstractPoxServiceTestImpl<Abstr
         Assert.assertNotNull(updatedIterationreportCommon);
 
         // Check selected fields in the updated common part.
-        Assert.assertEquals(updatedIterationreportCommon.getIterationreportReferenceNumber(),
-                transportCommon.getIterationreportReferenceNumber(),
+        Assert.assertEquals(updatedIterationreportCommon.getIterationIdentificationNumber(),
+                iterationreportCommon.getIterationIdentificationNumber(),
                 "Data in updated object did not match submitted data.");
     }
 
@@ -475,25 +471,25 @@ public class IterationreportServiceTest extends AbstractPoxServiceTestImpl<Abstr
     }
 
     /**
-     * Creates the transport instance.
+     * Creates the iterationreport instance.
      *
-     * @param transportNumber the transport number
+     * @param iterationreportNumber the iterationreport number
      * @return the multipart output
      * @throws Exception
      */
-    private PoxPayloadOut createIterationreportInstance(String transportNumber) throws Exception {
+    private PoxPayloadOut createIterationreportInstance(String iterationreportNumber) throws Exception {
 
-        IterationreportsCommon transportCommon = new IterationreportsCommon();
-        transportCommon.setIterationreportReferenceNumber(transportNumber);
-        // transportCommon.setDestination(getUTF8DataFragment());
+        IterationreportsCommon iterationreportCommon = new IterationreportsCommon();
+        iterationreportCommon.setIterationIdentificationNumber(iterationreportNumber);
+        // iterationreportCommon.setDestination(getUTF8DataFragment());
 
         PoxPayloadOut multipart = new PoxPayloadOut(this.getServicePathComponent());
         PayloadOutputPart commonPart =
-            multipart.addPart(new IterationreportClient().getCommonPartName(), transportCommon);
+            multipart.addPart(new IterationreportClient().getCommonPartName(), iterationreportCommon);
 
         if (logger.isDebugEnabled()) {
-            logger.debug("to be created, transport common");
-            logger.debug(objectAsXmlString(transportCommon, IterationreportsCommon.class));
+            logger.debug("to be created, iterationreport common");
+            logger.debug(objectAsXmlString(iterationreportCommon, IterationreportsCommon.class));
         }
 
         return multipart;
@@ -543,11 +539,11 @@ public class IterationreportServiceTest extends AbstractPoxServiceTestImpl<Abstr
      */
     @Override
     protected String getServicePathComponent() throws Exception {
-        return SERVICE_PATH_COMPONENT;
+        return IterationreportClient.SERVICE_PATH_COMPONENT;
     }
 
     @Override
     protected String getServiceName() {
-        return SERVICE_NAME;
+        return IterationreportClient.SERVICE_NAME;
     }
 }
index bc75d1885834710b0978fe247c58bd1319de16b6..d41204cc83548e30a6590472feb1a2cb8ce50432 100644 (file)
@@ -27,7 +27,7 @@
     <xs:element name="iterationreports_common">
         <xs:complexType>
             <xs:sequence>
-                <xs:element name="iterationreportReferenceNumber" type="xs:string"/>
+                <xs:element name="iterationIdentificationNumber" type="xs:string"/>
             </xs:sequence>
         </xs:complexType>
     </xs:element>