Commit 1eb99543 by Ashutosh Mestry

ATLAS-2909: ChangeMarker updated during initialization.

parent 7ffbec1a
......@@ -88,13 +88,8 @@ public class AtlasServerService {
}
@GraphTransaction
public AtlasServer save(AtlasServer server) {
try {
public AtlasServer save(AtlasServer server) throws AtlasBaseException {
return dataAccess.save(server);
} catch (AtlasBaseException e) {
return server;
}
}
@GraphTransaction
......
......@@ -524,7 +524,7 @@ public class AtlasTypeDefGraphStoreV2 extends AtlasTypeDefGraphStore {
}
private String getCurrentUser() {
String ret = RequestContext.get().getUser();
String ret = RequestContext.getCurrentUser();
if (StringUtils.isBlank(ret)) {
ret = System.getProperty("user.name");
......
......@@ -95,13 +95,11 @@ public class ExportServiceTest extends ExportImportTestBase {
public void setupTest() throws IOException, AtlasBaseException {
RequestContext.clear();
RequestContext.get().setUser(TestUtilsV2.TEST_USER, null);
ZipFileResourceTestUtils.loadBaseModel(typeDefStore, typeRegistry);
basicSetup(typeDefStore, typeRegistry);
}
@BeforeClass
public void setupSampleData() throws AtlasBaseException {
entityStore = new AtlasEntityStoreV2(deleteHandler, typeRegistry, mockChangeNotifier, graphMapper);;
AtlasTypesDef sampleTypes = TestUtilsV2.defineDeptEmployeeTypes();
AtlasTypesDef typesToCreate = AtlasTypeDefStoreInitializer.getTypesToCreate(sampleTypes, typeRegistry);
......
......@@ -93,6 +93,11 @@ public class RequestContext {
CURRENT_CONTEXT.remove();
}
public static String getCurrentUser() {
RequestContext context = CURRENT_CONTEXT.get();
return context != null ? context.getUser() : null;
}
public String getUser() {
return user;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment