diff --git a/src/main/java/device/cdPlayer/CDPlayer.java b/src/main/java/device/cdPlayer/CDPlayer.java index 07bb170..57101c8 100644 --- a/src/main/java/device/cdPlayer/CDPlayer.java +++ b/src/main/java/device/cdPlayer/CDPlayer.java @@ -162,7 +162,7 @@ public class CDPlayer implements Device { } public void setInfoText() { - this.infoText="CDPlayer: Item->"+actualPlayTrack+" from Album->"+this.loadedCD.getAlbumName()+" running."; + this.infoText=this.getClass().getSimpleName()+": Item->"+actualPlayTrack+" from Album->"+this.loadedCD.getAlbumName()+" running."; } diff --git a/src/test/java/device/cdPlayer/CDPlayerTest.java b/src/test/java/device/cdPlayer/CDPlayerTest.java index 8b9064e..e8d8f77 100644 --- a/src/test/java/device/cdPlayer/CDPlayerTest.java +++ b/src/test/java/device/cdPlayer/CDPlayerTest.java @@ -300,6 +300,9 @@ class CDPlayerTest { String albumName= _cdPlayer.getCD().getAlbumName(); assertThat(_cdPlayer.getInfoText().contains(albumName)).describedAs(testName).isEqualTo(true); } + if(cases.equals("Case5")) { + assertThat(_cdPlayer.getInfoText().contains("CDPlayer")).describedAs(testName).isEqualTo(true); + } } static Stream getInfoTestData () { @@ -319,7 +322,8 @@ class CDPlayerTest { Arguments.of("[getInfoText() by infoText=null ] => shouldThrowReturnValueNullException","Case1", cdPlayer1,new ReturnValueNullException(),""), Arguments.of("[getInfoText() by infoText=null ] => ExceptionShouldReturnAMessage","Case2",cdPlayer1,new ReturnValueNullException(),"Method should not return a Null-Value."), Arguments.of("[getInfoText() by infoText=Message ] => MessageShouldContainInfoOfActualPlayTrack","Case3",cdPlayer2,null,""), - Arguments.of("[getInfoText() by infoText=Message ] => MessageShouldContainInfoAboutAlbum","Case4",cdPlayer2,null,"") + Arguments.of("[getInfoText() by infoText=Message ] => MessageShouldContainInfoAboutAlbum","Case4",cdPlayer2,null,""), + Arguments.of("[getInfoText() by infoText=Message ] => MessageShouldContainInfoAboutDevice","Case5",cdPlayer2,null,"") ); }