Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Before
- public void setUp() {
- EmbeddedDatabase dataSource = new EmbeddedDatabaseBuilder()
- .addScripts("/schema.sql", "data.sql")
- .setType(H2)
- .generateUniqueName(true)
- .continueOnError(false)
- .ignoreFailedDrops(true)
- .setScriptEncoding("UTF-8")
- .build();
- repo = new JdbcFlightSubscriptionRepository(dataSource);
- }
- @Before
- public void setUp() throws Exception {
- org.apache.tomcat.jdbc.pool.DataSource dataSource = new org.apache.tomcat.jdbc.pool.DataSource();
- dataSource.setDriverClassName("com.mysql.jdbc.Driver");
- dataSource.setUrl("jdbc:mysql://dbxx:3306/xxx?characterEncoding=UTF-8");
- dataSource.setUsername("xxx");
- dataSource.setPassword("xxx");
- repo = new JdbcFlightSubscriptionRepository(dataSource);
- }
- format(from(flightPlan.getDepartureDateTimeUtc()), "yyyy-MM-dd"));
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd").withZone(ZoneId.of("UTC"));
- formatter.format(flightPlan.getDepartureDateTimeUtc());
- public static String format(Date date, String pattern) {
- return format((Date)date, pattern, (TimeZone)null, (Locale)null);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement