Skip to content

Commit

Permalink
Fix root path issue with persistence (#555)
Browse files Browse the repository at this point in the history
  • Loading branch information
etspaceman authored Aug 2, 2023
1 parent f2084d5 commit 4a538a5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions testkit/src/main/scala/kinesis/mock/instances/arbitrary.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
* limitations under the License.
*/

package kinesis.mock.cache
package kinesis.mock
package cache

import scala.concurrent.duration._

Expand Down Expand Up @@ -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)
}
}

0 comments on commit 4a538a5

Please sign in to comment.