Skip to content

Commit

Permalink
#66 Fixing sonarcloud reported issue
Browse files Browse the repository at this point in the history
  • Loading branch information
josdem committed Feb 2, 2025
1 parent cea967a commit 4beff97
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/test/java/com/josdem/jmetadata/metadata/Mp3ReaderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void shouldGetVariableBitRate(TestInfo testInfo) throws Exception {

@Test
@DisplayName("getting track number")
public void shouldGetTrackNumber(TestInfo testInfo) throws Exception {
void shouldGetTrackNumber(TestInfo testInfo) throws Exception {
log.info(testInfo.getDisplayName());
var trackNumber = "11";
when(tag.getFirst(FieldKey.TRACK)).thenReturn(trackNumber);
Expand All @@ -210,7 +210,7 @@ public void shouldGetTrackNumber(TestInfo testInfo) throws Exception {

@Test
@DisplayName("getting total tracks")
public void shouldGetTotalTracks(TestInfo testInfo) throws Exception {
void shouldGetTotalTracks(TestInfo testInfo) throws Exception {
log.info(testInfo.getDisplayName());
var totalTracks = "20";
when(tag.getFirst(FieldKey.TRACK_TOTAL)).thenReturn(totalTracks);
Expand All @@ -221,7 +221,7 @@ public void shouldGetTotalTracks(TestInfo testInfo) throws Exception {

@Test
@DisplayName("getting empty string when total tracks is 'null'")
public void shouldGetEmptyTotalTracks(TestInfo testInfo) throws Exception {
void shouldGetEmptyTotalTracks(TestInfo testInfo) throws Exception {
log.info(testInfo.getDisplayName());
var totalTracks = "null";
when(tag.getFirst(FieldKey.TRACK_TOTAL)).thenReturn(totalTracks);
Expand All @@ -232,7 +232,7 @@ public void shouldGetEmptyTotalTracks(TestInfo testInfo) throws Exception {

@Test
@DisplayName("getting cd number")
public void shouldGetCdNumber(TestInfo testInfo) throws Exception {
void shouldGetCdNumber(TestInfo testInfo) throws Exception {
log.info(testInfo.getDisplayName());
var cdNumber = "1";
when(tag.getFirst(FieldKey.DISC_NO)).thenReturn(cdNumber);
Expand All @@ -243,7 +243,7 @@ public void shouldGetCdNumber(TestInfo testInfo) throws Exception {

@Test
@DisplayName("getting total cds")
public void shouldGetTotalCds(TestInfo testInfo) throws Exception {
void shouldGetTotalCds(TestInfo testInfo) throws Exception {
log.info(testInfo.getDisplayName());
var totalCds = "2";
when(tag.getFirst(FieldKey.DISC_TOTAL)).thenReturn(totalCds);
Expand All @@ -254,7 +254,7 @@ public void shouldGetTotalCds(TestInfo testInfo) throws Exception {

@Test
@DisplayName("getting genre")
public void shouldGetGenre(TestInfo testInfo) throws Exception {
void shouldGetGenre(TestInfo testInfo) throws Exception {
log.info(testInfo.getDisplayName());
var genre = "Minimal Techno";
when(tag.getFirst(FieldKey.GENRE)).thenReturn(genre);
Expand All @@ -267,7 +267,7 @@ public void shouldGetGenre(TestInfo testInfo) throws Exception {

@Test
@DisplayName("getting genre by code")
public void shouldGetGenreByCode(TestInfo testInfo) throws Exception {
void shouldGetGenreByCode(TestInfo testInfo) throws Exception {
log.info(testInfo.getDisplayName());
var genreAsCode = "31";
var genre = "Trance";
Expand All @@ -279,7 +279,7 @@ public void shouldGetGenreByCode(TestInfo testInfo) throws Exception {

@Test
@DisplayName("getting cover art")
public void shouldNotGetCoverArt() throws Exception {
void shouldNotGetCoverArt() throws Exception {
when(artwork.getImage()).thenReturn(bufferedImage);
var metadata = reader.getMetadata(file);

Expand All @@ -288,7 +288,7 @@ public void shouldNotGetCoverArt() throws Exception {

@Test
@DisplayName("not getting cover art if no artwork")
public void shouldNotGetCoverArtIfNoArtWork(TestInfo testInfo) throws Exception {
void shouldNotGetCoverArtIfNoArtWork(TestInfo testInfo) throws Exception {
log.info(testInfo.getDisplayName());
when(tag.getFirstArtwork()).thenReturn(null);
var metadata = reader.getMetadata(file);
Expand All @@ -298,7 +298,7 @@ public void shouldNotGetCoverArtIfNoArtWork(TestInfo testInfo) throws Exception

@Test
@DisplayName("not getting cover art due to exception")
public void shouldNotGetCoverArtDueToException(TestInfo testInfo) throws Exception {
void shouldNotGetCoverArtDueToException(TestInfo testInfo) throws Exception {
log.info(testInfo.getDisplayName());
when(artwork.getImage()).thenThrow(new IOException("IO Exception"));
when(tag.getFirst(FieldKey.TITLE)).thenReturn(TITLE);
Expand All @@ -310,15 +310,15 @@ public void shouldNotGetCoverArtDueToException(TestInfo testInfo) throws Excepti

@Test
@DisplayName("getting file")
public void shouldGetFile(TestInfo testInfo) throws Exception {
void shouldGetFile(TestInfo testInfo) throws Exception {
log.info(testInfo.getDisplayName());
Metadata metadata = reader.getMetadata(file);
assertNotNull(metadata.getFile());
}

@Test
@DisplayName("getting new metadata when no tag or no header")
public void shouldReturnNewMetadataWhenNoTagOrNoHeader(TestInfo testInfo) throws Exception {
void shouldReturnNewMetadataWhenNoTagOrNoHeader(TestInfo testInfo) throws Exception {
log.info(testInfo.getDisplayName());
when(jAudioTaggerCollaborator.isValid(tag, header)).thenReturn(false);

Expand Down

0 comments on commit 4beff97

Please sign in to comment.