forked from zalando/nakadi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zalando#951 Replace AuthMode.OFF by AuthMode.NONE
- Loading branch information
Showing
4 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/test/java/org/zalando/nakadi/config/SecuritySettingsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.zalando.nakadi.config; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
import java.util.Arrays; | ||
import java.util.LinkedList; | ||
import java.util.List; | ||
|
||
public class SecuritySettingsTest { | ||
|
||
@Test | ||
public void doesNotRequireAuthentication() { | ||
Assert.assertTrue(SecuritySettings.AuthMode.NONE.isNoAuthentication()); | ||
Assert.assertTrue(SecuritySettings.AuthMode.OFF.isNoAuthentication()); | ||
} | ||
|
||
@Test | ||
public void mustRequireAuthentication() { | ||
final List<SecuritySettings.AuthMode> authModesWithoutAuthentication = | ||
new LinkedList<>(Arrays.asList(SecuritySettings.AuthMode.values())); | ||
authModesWithoutAuthentication.remove(SecuritySettings.AuthMode.NONE); | ||
authModesWithoutAuthentication.remove(SecuritySettings.AuthMode.OFF); | ||
authModesWithoutAuthentication.forEach(authMode -> | ||
Assert.assertFalse(authMode.isNoAuthentication())); | ||
} | ||
|
||
} |