Commit 1eb99543 by Ashutosh Mestry

ATLAS-2909: ChangeMarker updated during initialization.

parent 7ffbec1a
...@@ -88,13 +88,8 @@ public class AtlasServerService { ...@@ -88,13 +88,8 @@ public class AtlasServerService {
} }
@GraphTransaction @GraphTransaction
public AtlasServer save(AtlasServer server) { public AtlasServer save(AtlasServer server) throws AtlasBaseException {
return dataAccess.save(server);
try {
return dataAccess.save(server);
} catch (AtlasBaseException e) {
return server;
}
} }
@GraphTransaction @GraphTransaction
......
...@@ -524,7 +524,7 @@ public class AtlasTypeDefGraphStoreV2 extends AtlasTypeDefGraphStore { ...@@ -524,7 +524,7 @@ public class AtlasTypeDefGraphStoreV2 extends AtlasTypeDefGraphStore {
} }
private String getCurrentUser() { private String getCurrentUser() {
String ret = RequestContext.get().getUser(); String ret = RequestContext.getCurrentUser();
if (StringUtils.isBlank(ret)) { if (StringUtils.isBlank(ret)) {
ret = System.getProperty("user.name"); ret = System.getProperty("user.name");
......
...@@ -95,13 +95,11 @@ public class ExportServiceTest extends ExportImportTestBase { ...@@ -95,13 +95,11 @@ public class ExportServiceTest extends ExportImportTestBase {
public void setupTest() throws IOException, AtlasBaseException { public void setupTest() throws IOException, AtlasBaseException {
RequestContext.clear(); RequestContext.clear();
RequestContext.get().setUser(TestUtilsV2.TEST_USER, null); RequestContext.get().setUser(TestUtilsV2.TEST_USER, null);
ZipFileResourceTestUtils.loadBaseModel(typeDefStore, typeRegistry); basicSetup(typeDefStore, typeRegistry);
} }
@BeforeClass @BeforeClass
public void setupSampleData() throws AtlasBaseException { public void setupSampleData() throws AtlasBaseException {
entityStore = new AtlasEntityStoreV2(deleteHandler, typeRegistry, mockChangeNotifier, graphMapper);;
AtlasTypesDef sampleTypes = TestUtilsV2.defineDeptEmployeeTypes(); AtlasTypesDef sampleTypes = TestUtilsV2.defineDeptEmployeeTypes();
AtlasTypesDef typesToCreate = AtlasTypeDefStoreInitializer.getTypesToCreate(sampleTypes, typeRegistry); AtlasTypesDef typesToCreate = AtlasTypeDefStoreInitializer.getTypesToCreate(sampleTypes, typeRegistry);
......
...@@ -93,6 +93,11 @@ public class RequestContext { ...@@ -93,6 +93,11 @@ public class RequestContext {
CURRENT_CONTEXT.remove(); CURRENT_CONTEXT.remove();
} }
public static String getCurrentUser() {
RequestContext context = CURRENT_CONTEXT.get();
return context != null ? context.getUser() : null;
}
public String getUser() { public String getUser() {
return user; 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