ThriftHiveMetaStoreJUnitRule not working correctly with JUnit 5
Closed this issue · 5 comments
The ThriftHiveMetaStoreJUnitRule
is not correctly initialized when using JUnit 5.
When accessing the thriftConnectionUri
, it looks like it is instantiated with a port 0 (thrift://localhost:0).
Sample unit test to demonstrate the issue:
package com.beeju.test;
import com.hotels.beeju.ThriftHiveMetaStoreJUnitRule;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.jupiter.api.Test;
public class JUnit5Example {
@Rule
public ThriftHiveMetaStoreJUnitRule hive = new ThriftHiveMetaStoreJUnitRule("foo_db");
@Test
public void test_junit5() {
Assert.assertNotEquals(0, hive.getThriftPort());
}
}
@warciuch what was the exact version of Junit5? 5.3.2?
@massdosage It was 5.2.0
OK, thanks, good to know. We're not currently using JUnit 5, it's on our radar as something we'd like to get this working on but I don't have a timeline for when. If we start working on this we'll put a comment here, if you by any chance get the opportunity to take a look and submit a PR that would be very much welcome too.
sounds good, thanks @massdosage !
Full JUnit5 extension support is now available in BeeJU 3.0.0.