Skip to content

Commit 87de0cc

Browse files
committed
refactor: add annotations and organize main tests
1 parent 34c2b76 commit 87de0cc

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

core/src/main/java/com/linecorp/armeria/server/docs/DocServiceBuilder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,9 +558,10 @@ private static String[] guessAndSerializeExampleRequest(Object exampleRequest) {
558558

559559
/**
560560
* Sets the title of the web application to be used in the documentation service.
561-
* @param webAppTitle * The title cannot be null, empty, or exceed a maximum length of 50 characters.
561+
* @param webAppTitle The title cannot be null, empty, or exceed a maximum length of 50 characters.
562562
* @return The current {@link DocServiceBuilder} instance for method chaining.
563563
*/
564+
@UnstableApi
564565
public DocServiceBuilder webAppTitle(String webAppTitle) {
565566
requireNonNull(webAppTitle, WEB_APP_TITLE_KEY);
566567
checkArgument(!webAppTitle.trim().isEmpty(), "%s is empty.", WEB_APP_TITLE_KEY);

core/src/main/java/com/linecorp/armeria/server/docs/DocServiceInjectableScripts.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@
2020

2121
import java.util.regex.Pattern;
2222

23+
import com.linecorp.armeria.common.annotation.UnstableApi;
24+
2325
/**
2426
* Provides utilities for {@link DocServiceBuilder#injectedScripts(String...)}.
2527
*/
28+
@UnstableApi
2629
public final class DocServiceInjectableScripts {
2730

2831
private static final String HEX_COLOR_PATTERN = "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$";

core/src/test/java/com/linecorp/armeria/server/docs/DocServiceInjectableScriptsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void titleBackground_givenValidColor_returnsScriptWithColor(String color) {
4040
@ValueSource(strings = { "#1234567", "#ABCDEFA", "#7654321"})
4141
void titleBackground_givenTooLongColor_throwsException(String color) {
4242

43-
assertThatThrownBy(() -> DocServiceInjectableScripts.gotoBackground(color))
43+
assertThatThrownBy(() -> DocServiceInjectableScripts.titleBackground(color))
4444
.isInstanceOf(IllegalArgumentException.class)
4545
.hasMessageContaining("length exceeds");
4646
}
@@ -49,7 +49,7 @@ void titleBackground_givenTooLongColor_throwsException(String color) {
4949
@ValueSource(strings = { "#12345Z", "#ZABCDE", "#@12345"})
5050
void titleBackground_givenInvalidColor_throwsException(String color) {
5151

52-
assertThatThrownBy(() -> DocServiceInjectableScripts.gotoBackground(color))
52+
assertThatThrownBy(() -> DocServiceInjectableScripts.titleBackground(color))
5353
.isInstanceOf(IllegalArgumentException.class)
5454
.hasMessageContaining("not in hex format");
5555
}

0 commit comments

Comments
 (0)