Cleanup responses a bit more
This commit is contained in:
@@ -1,14 +0,0 @@
|
|||||||
package gq.kirmanak.mealient.datasource.v0.models
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
|
||||||
import kotlinx.serialization.Serializable
|
|
||||||
|
|
||||||
@Serializable
|
|
||||||
data class GetRecipeIngredientResponseV0(
|
|
||||||
@SerialName("title") val title: String = "",
|
|
||||||
@SerialName("note") val note: String = "",
|
|
||||||
@SerialName("unit") val unit: String = "",
|
|
||||||
@SerialName("food") val food: String = "",
|
|
||||||
@SerialName("disableAmount") val disableAmount: Boolean,
|
|
||||||
@SerialName("quantity") val quantity: Double,
|
|
||||||
)
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
package gq.kirmanak.mealient.datasource.v0.models
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
|
||||||
import kotlinx.serialization.Serializable
|
|
||||||
|
|
||||||
@Serializable
|
|
||||||
data class GetRecipeInstructionResponseV0(
|
|
||||||
@SerialName("title") val title: String = "",
|
|
||||||
@SerialName("text") val text: String,
|
|
||||||
)
|
|
||||||
@@ -11,3 +11,13 @@ data class GetRecipeResponseV0(
|
|||||||
@SerialName("recipeIngredient") val recipeIngredients: List<GetRecipeIngredientResponseV0>,
|
@SerialName("recipeIngredient") val recipeIngredients: List<GetRecipeIngredientResponseV0>,
|
||||||
@SerialName("recipeInstructions") val recipeInstructions: List<GetRecipeInstructionResponseV0>,
|
@SerialName("recipeInstructions") val recipeInstructions: List<GetRecipeInstructionResponseV0>,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class GetRecipeIngredientResponseV0(
|
||||||
|
@SerialName("note") val note: String = "",
|
||||||
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class GetRecipeInstructionResponseV0(
|
||||||
|
@SerialName("text") val text: String,
|
||||||
|
)
|
||||||
@@ -4,4 +4,6 @@ import kotlinx.serialization.SerialName
|
|||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class GetTokenResponseV0(@SerialName("access_token") val accessToken: String)
|
data class GetTokenResponseV0(
|
||||||
|
@SerialName("access_token") val accessToken: String,
|
||||||
|
)
|
||||||
@@ -5,7 +5,5 @@ import kotlinx.serialization.Serializable
|
|||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class VersionResponseV0(
|
data class VersionResponseV0(
|
||||||
@SerialName("production") val production: Boolean,
|
|
||||||
@SerialName("version") val version: String,
|
@SerialName("version") val version: String,
|
||||||
@SerialName("demoStatus") val demoStatus: Boolean,
|
|
||||||
)
|
)
|
||||||
@@ -4,4 +4,6 @@ import kotlinx.serialization.SerialName
|
|||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class ErrorDetailV1(@SerialName("detail") val detail: String? = null)
|
data class ErrorDetailV1(
|
||||||
|
@SerialName("detail") val detail: String? = null,
|
||||||
|
)
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
package gq.kirmanak.mealient.datasource.v1.models
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
|
||||||
import kotlinx.serialization.Serializable
|
|
||||||
|
|
||||||
@Serializable
|
|
||||||
data class GetRecipeIngredientResponseV1(
|
|
||||||
@SerialName("title") val title: String = "",
|
|
||||||
@SerialName("note") val note: String = "",
|
|
||||||
@SerialName("unit") val unit: String = "",
|
|
||||||
@SerialName("food") val food: String = "",
|
|
||||||
@SerialName("disableAmount") val disableAmount: Boolean,
|
|
||||||
@SerialName("quantity") val quantity: Double,
|
|
||||||
)
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
package gq.kirmanak.mealient.datasource.v1.models
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
|
||||||
import kotlinx.serialization.Serializable
|
|
||||||
|
|
||||||
@Serializable
|
|
||||||
data class GetRecipeInstructionResponseV1(
|
|
||||||
@SerialName("title") val title: String = "",
|
|
||||||
@SerialName("text") val text: String,
|
|
||||||
)
|
|
||||||
@@ -11,3 +11,8 @@ data class GetRecipeResponseV1(
|
|||||||
@SerialName("recipeIngredient") val recipeIngredients: List<GetRecipeIngredientResponseV1>,
|
@SerialName("recipeIngredient") val recipeIngredients: List<GetRecipeIngredientResponseV1>,
|
||||||
@SerialName("recipeInstructions") val recipeInstructions: List<GetRecipeInstructionResponseV1>,
|
@SerialName("recipeInstructions") val recipeInstructions: List<GetRecipeInstructionResponseV1>,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class GetRecipeIngredientResponseV1(
|
||||||
|
@SerialName("note") val note: String = "",
|
||||||
|
)
|
||||||
@@ -6,4 +6,9 @@ import kotlinx.serialization.Serializable
|
|||||||
@Serializable
|
@Serializable
|
||||||
data class GetRecipesResponseV1(
|
data class GetRecipesResponseV1(
|
||||||
@SerialName("items") val items: List<GetRecipeSummaryResponseV1>,
|
@SerialName("items") val items: List<GetRecipeSummaryResponseV1>,
|
||||||
|
)
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class GetRecipeInstructionResponseV1(
|
||||||
|
@SerialName("text") val text: String,
|
||||||
)
|
)
|
||||||
@@ -6,5 +6,4 @@ import kotlinx.serialization.Serializable
|
|||||||
@Serializable
|
@Serializable
|
||||||
data class GetTokenResponseV1(
|
data class GetTokenResponseV1(
|
||||||
@SerialName("access_token") val accessToken: String,
|
@SerialName("access_token") val accessToken: String,
|
||||||
@SerialName("token_type") val tokenType: String,
|
|
||||||
)
|
)
|
||||||
@@ -5,8 +5,5 @@ import kotlinx.serialization.Serializable
|
|||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class VersionResponseV1(
|
data class VersionResponseV1(
|
||||||
@SerialName("production") val production: Boolean,
|
|
||||||
@SerialName("version") val version: String,
|
@SerialName("version") val version: String,
|
||||||
@SerialName("demoStatus") val demoStatus: Boolean,
|
|
||||||
@SerialName("allowSignup") val allowSignup: Boolean,
|
|
||||||
)
|
)
|
||||||
@@ -62,7 +62,7 @@ class MealieDataSourceV0ImplTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `when getVersionInfo and getVersion returns result then result`() = runTest {
|
fun `when getVersionInfo and getVersion returns result then result`() = runTest {
|
||||||
val versionResponse = VersionResponseV0(true, "v0.5.6", true)
|
val versionResponse = VersionResponseV0("v0.5.6")
|
||||||
coEvery { service.getVersion(any()) } returns versionResponse
|
coEvery { service.getVersion(any()) } returns versionResponse
|
||||||
assertThat(subject.getVersionInfo(TEST_BASE_URL)).isSameInstanceAs(versionResponse)
|
assertThat(subject.getVersionInfo(TEST_BASE_URL)).isSameInstanceAs(versionResponse)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user