Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Maximezmt/music Itunes Api #45

Merged
merged 24 commits into from
Mar 11, 2022
Merged

Maximezmt/music Itunes Api #45

merged 24 commits into from
Mar 11, 2022

Conversation

MaximeZmt
Copy link
Owner

@MaximeZmt MaximeZmt commented Mar 8, 2022

Music API

This is related to issue #45

This Pull Requests contains:

  • ch.sdp.vibester.api: ItunesMusicApi: an api with a function querySong(...) that will return a song object
  • ch.sdp.vibester.model: Song: a class that represent a song containing differents attributes
  • ch.sdp.vibester: MusicTemporary: An activity that is used to test the music API

In addition the code is tested with a coverage of: [100]%

Notes for reviewers

  • The minapk has increased of one (to 24) to use the completableFuture API
  • The Readme has been updated with new Kamila username

@MaximeZmt MaximeZmt self-assigned this Mar 8, 2022
@MaximeZmt MaximeZmt marked this pull request as ready for review March 10, 2022 21:23
Copy link
Collaborator

@jiabaow jiabaow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work for both features and tests!
I left a few suggestions for clarity but it's already in pretty good shape

val intent =
Intent(ApplicationProvider.getApplicationContext(), MusicTemporary::class.java)
val scn: ActivityScenario<GreetingActivity> = ActivityScenario.launch(intent)
Espresso.onView(ViewMatchers.withId(R.id.musicName))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Espresso.onView(ViewMatchers.withId(R.id.musicName))
onView(withId(R.id.musicName))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work too (depends on your import) and it will be more consistent with the rest

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in my new commit :)

val scn: ActivityScenario<GreetingActivity> = ActivityScenario.launch(intent)
Espresso.onView(ViewMatchers.withId(R.id.musicName))
.perform(ViewActions.typeText(inputName), ViewActions.closeSoftKeyboard())
Espresso.onView(ViewMatchers.withId(R.id.validate)).perform(ViewActions.click())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Espresso.onView(ViewMatchers.withId(R.id.validate)).perform(ViewActions.click())
onView(withId(R.id.validate)).perform(ViewActions.click())

Espresso.onView(ViewMatchers.withId(R.id.musicName))
.perform(ViewActions.typeText(inputName), ViewActions.closeSoftKeyboard())
Espresso.onView(ViewMatchers.withId(R.id.validate)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(R.id.textViewPlaying))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Espresso.onView(ViewMatchers.withId(R.id.textViewPlaying))
onView(withId(R.id.textViewPlaying))

import android.os.Build
import android.util.Log
import ch.sdp.vibester.model.Song
//import com.android.volley.Request
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//import com.android.volley.Request

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in the new commit

import android.util.Log
import ch.sdp.vibester.model.Song
//import com.android.volley.Request
//import com.android.volley.toolbox.StringRequest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//import com.android.volley.toolbox.StringRequest

import ch.sdp.vibester.model.Song
//import com.android.volley.Request
//import com.android.volley.toolbox.StringRequest
//import com.android.volley.toolbox.Volley
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//import com.android.volley.toolbox.Volley

android:layout_marginTop="208dp"
android:layout_marginEnd="111dp"
android:layout_marginBottom="23dp"
android:text="Enter a Music Name:"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider using @string instead of hardcoded string

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but as it is a temporary activity, I didn't put it in the String.xml otherwise It will flood it with not important value :)

android:layout_marginEnd="89dp"
android:layout_marginBottom="28dp"
android:ems="10"
android:hint="Music Name"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

android:layout_marginTop="28dp"
android:layout_marginEnd="159dp"
android:layout_marginBottom="29dp"
android:text="Validate"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

android:layout_marginTop="15dp"
android:layout_marginEnd="179dp"
android:layout_marginBottom="267dp"
android:text="Playing: None"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@MaximeZmt
Copy link
Owner Author

Excellent work for both features and tests! I left a few suggestions for clarity but it's already in pretty good shape

I've also added javadoc that was not done before 😅 Now It's all good 👍

@codeclimate
Copy link

codeclimate bot commented Mar 11, 2022

Code Climate has analyzed commit 51d5918 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (80% is the threshold).

This pull request will bring the total coverage in the repository to 99.4% (0.2% change).

View more on Code Climate.

Copy link
Collaborator

@zwierski zwierski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, the code is very clear.

@MaximeZmt MaximeZmt merged commit 7737c55 into main Mar 11, 2022
@MaximeZmt MaximeZmt deleted the maximezmt/musicApi branch March 11, 2022 07:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API: find a music api that work well (#20) API: Create a basic class for a music server (#20)
3 participants