ifs-data-layer/ifs-data-service/src/test/java/org/innovateuk/ifs/competition/repository/CompetitionRepositoryIntegrationTest.java
// IFS-2263 -- ensure milestone dates aren't rounded up
IFS-2263 -- ensure milestone dates aren't rounded up
IFS - 2263 -- ensure milestone dates aren ' t rounded up
@Test
    @Rollback
    public void milestoneDatesTruncated() {
        final ZonedDateTime dateTime = ZonedDateTime.parse("2017-12-03T10:18:30.500Z");
        final ZonedDateTime expectedDateTime = ZonedDateTime.parse("2017-12-03T10:18:30.000Z");
        GrantTermsAndConditions termsAndConditions = new GrantTermsAndConditions();
        termsAndConditions.setId(1L);
        Competition competition = new Competition(null, null, "comp", dateTime, null, null, termsAndConditions);
        Competition savedCompetition = repository.save(competition);
        flushAndClearSession();
        Competition retrievedCompetition = repository.findById(savedCompetition.getId()).get();
        assertTrue(expectedDateTime.isEqual(retrievedCompetition.getStartDate()));
    }
@ Test @ Rollback public void milestoneDatesTruncated ( ) { final ZonedDateTime dateTime = ZonedDateTime . parse ( "2017-12-03T10:18:30.500Z" ) ; final ZonedDateTime expectedDateTime = ZonedDateTime . parse ( "2017-12-03T10:18:30.000Z" ) ; GrantTermsAndConditions termsAndConditions = new GrantTermsAndConditions ( ) ; termsAndConditions . setId ( 1L ) ; Competition competition = new Competition ( null , null , "comp" , dateTime , null , null , termsAndConditions ) ; Competition savedCompetition = repository . save ( competition ) ; flushAndClearSession ( ) ; Competition retrievedCompetition = repository . findById ( savedCompetition . getId ( ) ) . get ( ) ; assertTrue ( expectedDateTime . isEqual ( retrievedCompetition . getStartDate ( ) ) ) ; }
IFS-2263 -- ensure milestone dates aren't rounded up
IFS - 2263 -- ensure milestone dates aren ' t rounded up