📍Use lombok, reformat, and optimize the code (#1560)
* Use lombok, reformat, and optimize the code * Fix merge conflicts and some sonar issues Co-authored-by: va1m <va1m@email.com>
This commit is contained in:
@@ -23,22 +23,21 @@
|
||||
|
||||
package com.iluwatar.event.queue;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import javax.sound.sampled.UnsupportedAudioFileException;
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.io.IOException;
|
||||
import javax.sound.sampled.UnsupportedAudioFileException;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Testing the Audio service of the Queue
|
||||
* @author mkuprivecz
|
||||
*
|
||||
*/
|
||||
public class AudioTest {
|
||||
class AudioTest {
|
||||
|
||||
private Audio audio;
|
||||
|
||||
@@ -46,6 +45,7 @@ public class AudioTest {
|
||||
void createAudioInstance() {
|
||||
audio = new Audio();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test here that the playSound method works correctly
|
||||
* @throws UnsupportedAudioFileException when the audio file is not supported
|
||||
@@ -53,7 +53,7 @@ public class AudioTest {
|
||||
* @throws InterruptedException when the test is interrupted externally
|
||||
*/
|
||||
@Test
|
||||
public void testPlaySound() throws UnsupportedAudioFileException, IOException, InterruptedException {
|
||||
void testPlaySound() throws UnsupportedAudioFileException, IOException, InterruptedException {
|
||||
audio.playSound(audio.getAudioStream("./etc/Bass-Drum-1.wav"), -10.0f);
|
||||
// test that service is started
|
||||
assertTrue(audio.isServiceRunning());
|
||||
@@ -72,7 +72,7 @@ public class AudioTest {
|
||||
* @throws InterruptedException when the test is interrupted externally
|
||||
*/
|
||||
@Test
|
||||
public void testQueue() throws UnsupportedAudioFileException, IOException, InterruptedException {
|
||||
void testQueue() throws UnsupportedAudioFileException, IOException, InterruptedException {
|
||||
audio.playSound(audio.getAudioStream("./etc/Bass-Drum-1.aif"), -10.0f);
|
||||
audio.playSound(audio.getAudioStream("./etc/Bass-Drum-1.aif"), -10.0f);
|
||||
audio.playSound(audio.getAudioStream("./etc/Bass-Drum-1.aif"), -10.0f);
|
||||
|
Reference in New Issue
Block a user