From ca80ef541ac28dc22c138d61d2ced7ed117d3192 Mon Sep 17 00:00:00 2001 From: kilicmustafa Date: Sun, 6 Jun 2021 20:29:21 +0300 Subject: [PATCH] fix optional query param --- .../java/com/enciyo/flippermocknetworkplugin/model/Mock.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flipmock/src/main/java/com/enciyo/flippermocknetworkplugin/model/Mock.kt b/flipmock/src/main/java/com/enciyo/flippermocknetworkplugin/model/Mock.kt index 7431b21..9e256a3 100644 --- a/flipmock/src/main/java/com/enciyo/flippermocknetworkplugin/model/Mock.kt +++ b/flipmock/src/main/java/com/enciyo/flippermocknetworkplugin/model/Mock.kt @@ -24,7 +24,9 @@ internal fun Mock.isSameEndpoint(outMock: Mock) = internal fun Mock.isSameMock(outMock: Mock) = endpoint == outMock.endpoint && - queryParams == outMock.queryParams && isSameRequestType(outMock) + (if (queryParams.isEmpty()) true else queryParams == outMock.queryParams) && isSameRequestType(outMock) + + internal fun Mock.isSameRequestType(outMock: Mock) = requestType == null ||