package de.jeha.s3srv;

import org.junit.Test;

import static org.junit.Assert.assertFalse;

/**
 * @author jenshadlich@googlemail.com
 */
public class BucketNameValidatorTest {

    @Test
    public void test() {

        // valid
/*
        assertTrue(BucketNameValidator.isValid("abc"));
        assertTrue(BucketNameValidator.isValid("myawsbucket"));
        assertTrue(BucketNameValidator.isValid("my.aws.bucket"));
        assertTrue(BucketNameValidator.isValid("myawsbucket.1"));
*/
        // not valid, too short
        assertFalse(BucketNameValidator.isValid("a"));
        assertFalse(BucketNameValidator.isValid("ab"));

        // not valid
        assertFalse(BucketNameValidator.isValid(null));
        assertFalse(BucketNameValidator.isValid(".myawsbucket"));
        assertFalse(BucketNameValidator.isValid("myawsbucket."));
        assertFalse(BucketNameValidator.isValid("my..examplebucket"));
    }

}

@@ -276,18 +276,18 @@
 sValid(%22
-a
 b
+u
 c%22));%0A  
@@ -330,27 +330,24 @@
 .isValid(%22my
-aws
 bucket%22));%0A 
@@ -400,18 +400,77 @@
 %22my.
-aws.
+bucket%22));%0A        assertTrue(BucketNameValidator.isValid(%22my
 bucket
+.1
 %22));
@@ -524,19 +524,15 @@
 (%22my
-aws
+-
 bucket
-.1
 %22));
@@ -616,17 +616,17 @@
 sValid(%22
-a
+b
 %22));%0A   
@@ -675,10 +675,10 @@
 id(%22
-a
 b
+u
 %22));
@@ -808,19 +808,16 @@
 lid(%22.my
-aws
 bucket%22)
@@ -874,11 +874,8 @@
 (%22my
-aws
 buck
@@ -939,15 +939,8 @@
 my..
-example
 buck

add test cases