diff --git a/kinesis-mock/src/main/scala/kinesis/mock/cache/PersistConfig.scala b/kinesis-mock/src/main/scala/kinesis/mock/cache/PersistConfig.scala index 81ed8df2..f2bc38ee 100644 --- a/kinesis-mock/src/main/scala/kinesis/mock/cache/PersistConfig.scala +++ b/kinesis-mock/src/main/scala/kinesis/mock/cache/PersistConfig.scala @@ -46,7 +46,7 @@ final case class PersistConfig( if (!path.startsWith("/")) { createPath(Path("."), path) } else { - createPath(Path("."), path.drop(1)) + createPath(Path("/"), path.drop(1)) } } def osFile = osPath / fileName diff --git a/testkit/src/main/scala/kinesis/mock/instances/arbitrary.scala b/testkit/src/main/scala/kinesis/mock/instances/arbitrary.scala index 15682946..419efbdc 100644 --- a/testkit/src/main/scala/kinesis/mock/instances/arbitrary.scala +++ b/testkit/src/main/scala/kinesis/mock/instances/arbitrary.scala @@ -14,7 +14,8 @@ * limitations under the License. */ -package kinesis.mock.instances +package kinesis.mock +package instances import scala.collection.SortedMap import scala.collection.immutable.Queue @@ -25,7 +26,6 @@ import java.time.Instant import enumeratum.scalacheck._ import org.scalacheck.{Arbitrary, Gen} -import kinesis.mock.Utils import kinesis.mock.api._ import kinesis.mock.models._ import kinesis.mock.regexp.RegexpGen diff --git a/unit-tests/src/test/scala/kinesis/mock/cache/PersistenceTests.scala b/unit-tests/src/test/scala/kinesis/mock/cache/PersistenceTests.scala index 44549730..8900db7d 100644 --- a/unit-tests/src/test/scala/kinesis/mock/cache/PersistenceTests.scala +++ b/unit-tests/src/test/scala/kinesis/mock/cache/PersistenceTests.scala @@ -14,7 +14,8 @@ * limitations under the License. */ -package kinesis.mock.cache +package kinesis.mock +package cache import scala.concurrent.duration._ @@ -139,4 +140,13 @@ class PersistenceTests ) } ) + + test("It should make a root path") { + val config = { + val orig = persistConfig(Utils.randomUUIDString) + orig.copy(path = s"/${orig.path}") + } + + assertEquals(config.osPath.absolute.toString, config.path) + } }