Fixed most reported issues by SonarCloud.
This commit is contained in:
		@@ -25,12 +25,23 @@ package com.iluwatar.abstractfactory;
 | 
			
		||||
 | 
			
		||||
import org.junit.jupiter.api.Test;
 | 
			
		||||
 | 
			
		||||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Tests that Abstract Factory example runs without errors.
 | 
			
		||||
 */
 | 
			
		||||
public class AppTest {
 | 
			
		||||
class AppTest {
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * Issue: Add at least one assertion to this test case.
 | 
			
		||||
   *
 | 
			
		||||
   * Solution: Inserted assertion to check whether the execution of the main method in {@link App}
 | 
			
		||||
   * throws an exception.
 | 
			
		||||
   */
 | 
			
		||||
 | 
			
		||||
  @Test
 | 
			
		||||
  public void test() {
 | 
			
		||||
    App.main(new String[]{});
 | 
			
		||||
  void shouldExecuteApplicationWithoutException() {
 | 
			
		||||
 | 
			
		||||
    assertDoesNotThrow(() -> App.main(new String[]{}));
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user