![test local dynamodb connection test local dynamodb connection](https://raw.githubusercontent.com/ganshan/sam-dynamodb-local/master/process_flow.png)
Can't I somehow ask the JVM to fork itself and look inside the resources to build a classpath? Or, even better, can't I just call the main method of DynamoDB Local from some other thread so this all happens in a single process? Any ideas? DynamoDB Local is, after all, just Java code. It seems like there should be an easier way. Besides being slow, the potential for left-over processes seems ugly.
#Test local dynamodb connection zip file#
zip file of the DynamoDB local stuff in test/resources, then in the method, I'd extract it to some temporary directory and start a new java process to execute it. I have found a way to make this work, but it's ugly, so I'm looking for alternatives. That way anyone pulling down the git repo gets a copy of everything they need to run the tests and each test is independent of the others. Then before each test I'd start it up, running with -inMemory, and after the test I'd stop it. What I want to do is something like put the DynamoDB local jar, and the other jars upon which it depends, in my test/resources directory (I'm writing in Java). All developers need to have it installed.
![test local dynamodb connection test local dynamodb connection](https://miro.medium.com/max/568/1*Xze_Xz2roNj82VzejItFdg.png)
The server isn't started and stopped before each test so tests become inter-dependent unless you add code to delete all tables, etc.You have to somehow start the server before your tests run.I'm using DynamoDB local for unit testing.