Skip to content

Commit

Permalink
Fix: Test som feiler på interval cast to string. (#647)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsladek authored Jul 11, 2024
1 parent d5f42ec commit de23d31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package no.nav.vedtak.felles.prosesstask.impl;

import java.time.LocalDateTime;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
Expand All @@ -20,7 +18,7 @@ class StartupData {
String inputtid;

@Column(name="inputtid2")
LocalDateTime inputtid2;
String inputtid2;

@Column(name="drift")
String drift;
Expand All @@ -29,7 +27,7 @@ class StartupData {
// for hibernate
}

public StartupData(String dbtz, String dbtid, String inputtid, LocalDateTime inputtid2, String drift) {
public StartupData(String dbtz, String dbtid, String inputtid, String inputtid2, String drift) {
this.dbtz = dbtz;
this.dbtid = dbtid;
this.inputtid = inputtid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,13 +386,13 @@ private void logDatabaseDetaljer() {
+ " to_char(current_timestamp, 'YYYY-MM-DD HH24:MI:SS.US+TZ') as dbtid,"
+ " to_char(cast(:inputTid as timestamp with time zone), 'YYYY-MM-DD HH24:MI:SS.US+TZ') as inputtid,"
+ " :inputTid as inputtid2,"
+ " (current_timestamp - :inputTid) as drift";
+ " to_char((current_timestamp - :inputTid), 'YYYY-MM-DD HH24:MI:SS.US') as drift";
} else if (DatabaseUtil.isOracle(entityManager)) {
sql = "select DBTIMEZONE as dbtz,"
+ " to_char(current_timestamp, 'YYYY-MM-DD HH24:MI:SSxFF6+TZH:TZM') as dbtid,"
+ " to_char(cast(:inputTid as timestamp with time zone), 'YYYY-MM-DD HH24:MI:SSxFF6+TZH:TZM') as inputtid,"
+ " :inputTid as inputtid2,"
+ " (current_timestamp - :inputTid) as drift"
+ " to_char((current_timestamp - :inputTid), 'YYYY-MM-DD HH24:MI:SSxFF6') as drift"
+ " from dual";
} else {
throw new UnsupportedOperationException("Unsupported Database: " + DatabaseUtil.getDialect(entityManager));
Expand Down

0 comments on commit de23d31

Please sign in to comment.