Github user dsmiley commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/428#discussion_r208248179
  
    --- Diff: 
solr/core/src/test/org/apache/solr/update/processor/ParsingFieldUpdateProcessorsTest.java
 ---
    @@ -171,59 +162,56 @@ public void testParseUSPacificDate() throws Exception 
{
                                          doc(f("id", "288"), 
f("not_in_schema", dateString)));
         assertNotNull(d);
         assertTrue(d.getFieldValue("not_in_schema") instanceof Date);
    -    assertEquals(dateStringUTC, 
    -                 (new 
DateTime(((Date)d.getFieldValue("not_in_schema")).getTime(),DateTimeZone.UTC)).toString());
    +    assertEquals(dateStringUTC,
    +        
(ZonedDateTime.ofInstant(((Date)d.getFieldValue("not_in_schema")).toInstant(), 
ZoneOffset.UTC)).format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSz",
 Locale.ROOT)));
    --- End diff --
    
    This can simply be:
    ```
    assertEquals(Instant.parse("2010-08-09T07:00:00.000Z"), 
((Date)d.getFieldValue("not_in_schema")).toInstant());
    ```
    Compare Instants; needn't do any formatting which adds complication.
    (I'll do it)


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to