/*
 * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
 * (the "License"). You may not use this work except in compliance with the License, which is
 * available at www.apache.org/licenses/LICENSE-2.0
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied, as more fully set forth in the License.
 *
 * See the NOTICE file distributed with this work for information regarding copyright ownership.
 */

package alluxio.master.file;

import static org.junit.Assert.assertEquals;

import alluxio.AlluxioURI;
import alluxio.master.file.StartupConsistencyCheck.Status;

import com.google.common.collect.ImmutableList;
import org.junit.Test;

import java.util.Collections;
import java.util.List;

/**
 * Unit tests for {@link StartupConsistencyCheck}.
 */
public final class StartupConsistencyCheckTest {
    @Test
    public void createCompleteCheck() {
        List<AlluxioURI> uris = ImmutableList.of(new AlluxioURI("/"), new AlluxioURI("/dir"));
        StartupConsistencyCheck check = StartupConsistencyCheck.complete(uris);
        assertEquals(Status.COMPLETE, check.getStatus());
        assertEquals(uris, check.getInconsistentUris());
    }

    @Test
    public void createDisabledCheck() {
        StartupConsistencyCheck check = StartupConsistencyCheck.disabled();
        assertEquals(Status.DISABLED, check.getStatus());
        assertEquals(Collections.EMPTY_LIST, check.getInconsistentUris());
    }

    @Test
    public void createFailedCheck() {
        StartupConsistencyCheck check = StartupConsistencyCheck.failed();
        assertEquals(Status.FAILED, check.getStatus());
        assertEquals(Collections.EMPTY_LIST, check.getInconsistentUris());
    }

    @Test
    public void createRunningCheck() {
        StartupConsistencyCheck check = StartupConsistencyCheck.running();
        assertEquals(Status.RUNNING, check.getStatus());
        assertEquals(Collections.EMPTY_LIST, check.getInconsistentUris());
    }
}

@@ -904,26 +904,24 @@
 kTest %7B%0A
-  
   @Test%0A
     publ
@@ -904,34 +904,32 @@
 kTest %7B%0A  @Test%0A
-  
   public void cr
@@ -946,28 +946,24 @@
 teCheck() %7B%0A
-    
     List%3CAll
@@ -1041,28 +1041,24 @@
 dir%22));%0A    
-  
-  
 StartupConsi
@@ -1117,20 +1117,16 @@
 (uris);%0A
-    
     asse
@@ -1167,36 +1167,32 @@
 tStatus());%0A    
-   
- 
 assertEquals(uri
@@ -1224,33 +1224,29 @@
 ris());%0A
-  
   %7D%0A%0A
-  
   @Test%0A
     publ
@@ -1229,34 +1229,32 @@
 );%0A  %7D%0A%0A  @Test%0A
-  
   public void cr
@@ -1271,36 +1271,32 @@
 edCheck() %7B%0A    
-   
- 
 StartupConsisten
@@ -1343,28 +1343,24 @@
 disabled();%0A
-    
     assertEq
@@ -1393,36 +1393,32 @@
 k.getStatus());%0A
-    
     assertEquals
@@ -1472,35 +1472,29 @@
 ris());%0A
-  
   %7D%0A%0A  
- 
- 
 @Test%0A
-  
   public
@@ -1513,36 +1513,32 @@
 FailedCheck() %7B%0A
-    
     StartupConsi
@@ -1587,28 +1587,24 @@
 k.failed();%0A
-    
     assertEq
@@ -1635,36 +1635,32 @@
 k.getStatus());%0A
-    
     assertEquals
@@ -1720,23 +1720,19 @@
 ;%0A  
- 
- 
 %7D%0A%0A
-  
   @Test%0A
     
@@ -1727,18 +1727,16 @@
   @Test%0A
-  
   public
@@ -1764,20 +1764,16 @@
 eck() %7B%0A
-    
     Star
@@ -1835,28 +1835,24 @@
 ning();%0A    
- 
-   
 assertEquals
@@ -1888,20 +1888,16 @@
 tus());%0A
-    
     asse
@@ -1959,16 +1959,14 @@
 ris());%0A
-  
   %7D%0A%7D%0A

Fix checkstyle