test_class.file: herd-code/herd-model-api-15/src/test/java/org/finra/herd/model/api/adapters/RegistrationDateAdapterTest.java
test_class.identifier: RegistrationDateAdapterTest
test_case.body: @Test
      public void unmarshalAllAllowedFormatsTest() throws Exception
      {
          RegistrationDateAdapter adapter = new RegistrationDateAdapter();
  
          // test for pattern: "yyyy-MM-dd"
          XMLGregorianCalendar calendar = adapter.unmarshal("2020-02-02");
          compareCalendarWithExpectedValues(calendar, 2020, 2, 2, 0, 0, 0);
  
          // test for pattern: "yyyy-MM-dd'T'HH:mm"
          calendar = adapter.unmarshal("2015-12-25T00:01");
          compareCalendarWithExpectedValues(calendar, 2015, 12, 25, 0, 1, 0);
  
          // test for pattern: "yyyy-MM-dd'T'HH:mmZ"
          calendar = adapter.unmarshal("2015-12-25T00:01+04:00");
          compareCalendarWithExpectedValues(calendar, 2015, 12, 24, 20, 1, 0);
  
          // test for pattern: "yyyy-MM-dd'T'HH:mm:ss"
          calendar = adapter.unmarshal("2018-02-03T10:00:02");
          compareCalendarWithExpectedValues(calendar, 2018, 2, 3, 10, 0, 2);
  
          // test for pattern: "yyyy-MM-dd'T'HH:mm:ssZ"
          calendar = adapter.unmarshal("2018-02-03T10:00:02+04:00");
          compareCalendarWithExpectedValues(calendar, 2018, 2, 3, 6, 0, 2);
  
          // test for pattern: "yyyy-MM-dd HH:mm:ssZ"
          calendar = adapter.unmarshal("2018-02-03 10:00:02+05:30");
          compareCalendarWithExpectedValues(calendar, 2018, 2, 3, 4, 30, 2);
  
          // test for pattern: "yyyy-MM-dd HH:mm:ss"
          calendar = adapter.unmarshal("2018-03-03 00:20:02");
          compareCalendarWithExpectedValues(calendar, 2018, 3, 3, 0, 20, 2);
      }
test_case.class_method_signature: RegistrationDateAdapterTest.unmarshalAllAllowedFormatsTest()
test_case.full_signature: @Test public void unmarshalAllAllowedFormatsTest()
test_case.identifier: unmarshalAllAllowedFormatsTest
test_case.invocations: unmarshal compareCalendarWithExpectedValues unmarshal compareCalendarWithExpectedValues unmarshal compareCalendarWithExpectedValues unmarshal compareCalendarWithExpectedValues unmarshal compareCalendarWithExpectedValues unmarshal compareCalendarWithExpectedValues unmarshal compareCalendarWithExpectedValues
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void unmarshalAllAllowedFormatsTest()
focal_class.file: herd-code/herd-model-api-15/src/main/java/org/finra/herd/model/api/adapters/RegistrationDateAdapter.java
focal_class.identifier: RegistrationDateAdapter
focal_class.class_method_signature: RegistrationDateAdapter.unmarshal(String datetime)
focal_class.full_signature: @Override public XMLGregorianCalendar unmarshal(String datetime)
focal_class.identifier: unmarshal
focal_class.modifiers: @Override public
focal_class.parameters: (String datetime)
focal_class.return: XMLGregorianCalendar
focal_class.signature: XMLGregorianCalendar unmarshal(String datetime)
focal_class.class_method_signature: RegistrationDateAdapter.marshal(XMLGregorianCalendar xmlGregorianCalendar)
focal_class.full_signature: @Override public String marshal(XMLGregorianCalendar xmlGregorianCalendar)
focal_class.identifier: marshal
focal_class.modifiers: @Override public
focal_class.parameters: (XMLGregorianCalendar xmlGregorianCalendar)
focal_class.return: String
focal_class.signature: String marshal(XMLGregorianCalendar xmlGregorianCalendar)
focal_class.superclass: extends XmlAdapter<String, XMLGregorianCalendar>
focal_method.body: @Override
      public XMLGregorianCalendar unmarshal(String datetime) throws Exception
      {
          try
          {
              final DateTimeParser[] parsers =
                  {
                      DateTimeFormat.forPattern("yyyy-MM-dd").getParser(),
                      DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm").getParser(),
                      DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mmZ").getParser(),
                      DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss").getParser(),
                      DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ssZ").getParser(),
                      DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss").getParser(),
                      DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ssZ").getParser()
                  };
  
              DateTimeFormatter dateTimeFormatter = new DateTimeFormatterBuilder().append(null, parsers).toFormatter();
  
              DateTime dateTime = dateTimeFormatter.withZoneUTC().parseDateTime(datetime.trim());
  
              return DatatypeFactory.newInstance().newXMLGregorianCalendar(dateTime.toGregorianCalendar());
          }
          catch (IllegalArgumentException e)
          {
              // Since the original exception carries an error message which gives away 'too much information', we are having it
              // swallowed and instead returning a generic error message.
              throw new IllegalArgumentException("Valid date or date and time format must be used when specifying values for start/end registration dates.");
          }
      }
focal_method.class_method_signature: RegistrationDateAdapter.unmarshal(String datetime)
focal_method.full_signature: @Override public XMLGregorianCalendar unmarshal(String datetime)
focal_method.identifier: unmarshal
focal_method.invocations: getParser forPattern getParser forPattern getParser forPattern getParser forPattern getParser forPattern getParser forPattern getParser forPattern toFormatter append parseDateTime withZoneUTC trim newXMLGregorianCalendar newInstance toGregorianCalendar
focal_method.modifiers: @Override public
focal_method.parameters: (String datetime)
focal_method.return: XMLGregorianCalendar
focal_method.signature: XMLGregorianCalendar unmarshal(String datetime)