"MealPlannerClient" is an abstraction layer between MealTime and the Edamam Meal Planner API. It encapsulates the logic for making HTTP requests to the API endpoints, handling the request parameters, and processing the response.
Updated On 3/4/2024 Made a new version of the client; added a testing class
Steps To Reproduce:
Make sure Retrofit is properly implemented in build.gradle.kts
Initialize Retrofit using MealPlannerService, make sure to include the correct URL
When making the code include all the parameters that are to be passed to the URL
Expected Vs Actual Behavior:
Expected Behavior: Take the data submitted and send it to MealPlannerService, if successful return data, if not cause error
Actual Behavior: Encountering errors with connecting to the service
@Test
public void testConnectionToEdamamMealPlanner() {
// Create an instance of EdamamApiManager
EdamamApiManager apiManager = new EdamamApiManager(getContext());
// Call the searchRecipes method with sample parameters
apiManager.searchRecipes();
// Since the searchRecipes method makes an asynchronous call,
// you may want to add some assertions or verify some behavior here
}
// Helper method to get a mock context
private Context getContext() {
return Mockito.mock(Context.class);
}
}
`
Environment Details:
Operating System: Windows 11
Firebase SDK Version: 23.0.0
Kotlin Version: 1.5.21
Android Studio Version: 4.2.1
Gradle Version: 7.0.2
API - Edamam Meal Planner - Meal Planner Client
Description:
"MealPlannerClient" is an abstraction layer between MealTime and the Edamam Meal Planner API. It encapsulates the logic for making HTTP requests to the API endpoints, handling the request parameters, and processing the response.
Updated On 3/4/2024 Made a new version of the client; added a testing class
Steps To Reproduce:
Expected Vs Actual Behavior:
Expected Behavior: Take the data submitted and send it to MealPlannerService, if successful return data, if not cause error Actual Behavior: Encountering errors with connecting to the service
Code Snippets:
`import android.content.Context; import android.widget.Toast; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response;
public class EdamamApiManager {
}`
`package com.example.mealtime1.APIs.MealPlannerTest;
import android.content.Context;
import org.junit.Test; import org.mockito.Mockito;
public class EdamamApiManagerTest {
} `
Environment Details:
Operating System: Windows 11 Firebase SDK Version: 23.0.0 Kotlin Version: 1.5.21 Android Studio Version: 4.2.1 Gradle Version: 7.0.2
Current Status: COMPLETED