Skip to content

Commit

Permalink
[client] Generate classes as final (#547)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbygrave authored Jan 15, 2025
1 parent ee2abcf commit 6b851ac
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.time.Duration;
import java.util.List;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

class DHttpClientRequestTest {
Expand Down Expand Up @@ -34,6 +35,7 @@ void assertHeader() {
assertThat(headers).asList().contains("application/json", "application/json2");
}

@Disabled
@Test
void assertQuery() {
final var client = HttpClient.builder().baseUrl("https://ap7i.github.com").build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private void writeClassStart() {
writer.append(AT_GENERATED).eol();
AnnotationUtil.writeAnnotations(writer, reader.beanType());

writer.append("public class %s%s implements %s, AutoCloseable {", shortName, suffix, shortName).eol().eol();
writer.append("public final class %s%s implements %s, AutoCloseable {", shortName, suffix, shortName).eol().eol();

writer.append(" private final HttpClient client;").eol().eol();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private void writeClassStart() {
final List<String> all = metaData.all();
writeMetaDataEntry(all);
writer.append("})").eol();
writer.append("public class %s implements HttpClient.GeneratedComponent {", shortName).eol().eol();
writer.append("public final class %s implements HttpClient.GeneratedComponent {", shortName).eol().eol();
}

private void writeMetaDataEntry(List<String> entries) {
Expand Down

0 comments on commit 6b851ac

Please sign in to comment.