-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Changes the path of the global time-shift endpoint - Integrates and configures OpenAPI 3.0 dependency - Annotates Management endpoints - Adds new test cases Resolves #83 {minor}
- Loading branch information
Showing
15 changed files
with
340 additions
and
12 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
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
206 changes: 200 additions & 6 deletions
206
...p/src/main/java/com/github/nagyesta/lowkeyvault/controller/VaultManagementController.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
36 changes: 36 additions & 0 deletions
36
lowkey-vault-app/src/main/java/com/github/nagyesta/lowkeyvault/openapi/Examples.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,36 @@ | ||
package com.github.nagyesta.lowkeyvault.openapi; | ||
|
||
public final class Examples { | ||
/** | ||
* Example base URI of a vault. | ||
*/ | ||
public static final String BASE_URI = "https://vault.localhost:8443"; | ||
/** | ||
* The literal 1 as a String. | ||
*/ | ||
public static final String ONE = "1"; | ||
/** | ||
* The literal 42 as a String. | ||
*/ | ||
public static final String FORTY_TWO = "42"; | ||
/** | ||
* The value of {@link com.github.nagyesta.lowkeyvault.model.v7_2.common.constants.RecoveryLevel#CUSTOMIZED_RECOVERABLE_AND_PURGEABLE}. | ||
*/ | ||
public static final String CUSTOMIZED_RECOVERABLE_PURGEABLE = "CustomizedRecoverable+Purgeable"; | ||
/** | ||
* UTC Epoch seconds format of 2022-01-02 03:04:05 AM. | ||
*/ | ||
public static final String EPOCH_SECONDS_2022_01_02_AM_03H_04M_05S = "1641092645"; | ||
/** | ||
* Example value of an exception class. | ||
*/ | ||
public static final String EXCEPTION = "java.lang.IllegalArgumentException"; | ||
/** | ||
* Error message example. | ||
*/ | ||
public static final String ERROR_MESSAGE = "BaseUri must be populated."; | ||
|
||
private Examples() { | ||
throw new IllegalCallerException("Utility cannot be instantiated."); | ||
} | ||
} |
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
22 changes: 22 additions & 0 deletions
22
lowkey-vault-app/src/test/java/com/github/nagyesta/lowkeyvault/openapi/ExamplesTest.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,22 @@ | ||
package com.github.nagyesta.lowkeyvault.openapi; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.lang.reflect.Constructor; | ||
import java.lang.reflect.InvocationTargetException; | ||
|
||
class ExamplesTest { | ||
|
||
@Test | ||
void testConstructorShouldThrowExceptionWhenCalled() throws NoSuchMethodException { | ||
//given | ||
final Constructor<Examples> constructor = Examples.class.getDeclaredConstructor(); | ||
constructor.setAccessible(true); | ||
|
||
//when | ||
Assertions.assertThrows(InvocationTargetException.class, constructor::newInstance); | ||
|
||
//then + exception | ||
} | ||
} |
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