Skip to content

Commit 4a3a07a

Browse files
committed
Fix spotbugs and typos
1 parent 9c5c320 commit 4a3a07a

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

ballerina-to-openapi/src/main/java/io/ballerina/openapi/service/mapper/ServersMapperImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ private static Server generateServer(String serviceBasePath, Optional<Parenthesi
191191
Server server = new Server();
192192

193193
if (list.isPresent()) {
194-
SeparatedNodeList<FunctionArgumentNode> args = list.get().arguments();
195-
for (FunctionArgumentNode arg : args) {
194+
for (FunctionArgumentNode arg : list.get().arguments()) {
196195
if (arg instanceof NamedArgumentNode namedArg) {
197196
ExpressionNode expr = namedArg.expression();
198197
if (namedArg.argumentName().toString().trim().equals("port")) {

openapi-cli/src/test/java/io/ballerina/openapi/generators/openapi/ListenerTests.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,26 +93,26 @@ public void testListeners07() throws IOException {
9393

9494
@Test(description = "Generate OpenAPI spec for listener with named port arguments")
9595
public void testListenerWithNamedPort() throws IOException {
96-
Path ballerinaFilePAth = RES_DIR.resolve("listeners/listener_named_port.bal");
97-
TestUtils.compareWithGeneratedFile(ballerinaFilePAth, "listeners/listener_named_port.yaml");
96+
Path ballerinaFilePath = RES_DIR.resolve("listeners/listener_named_port.bal");
97+
TestUtils.compareWithGeneratedFile(ballerinaFilePath, "listeners/listener_named_port.yaml");
9898
}
9999

100100
@Test(description = "Generate OpenAPI spec for listener with positional port arguments")
101101
public void testListenerWithPositionalPort() throws IOException {
102-
Path ballerinaFilePAth = RES_DIR.resolve("listeners/listener_positional_port.bal");
103-
TestUtils.compareWithGeneratedFile(ballerinaFilePAth, "listeners/listener_positional_port.yaml");
102+
Path ballerinaFilePath = RES_DIR.resolve("listeners/listener_positional_port.bal");
103+
TestUtils.compareWithGeneratedFile(ballerinaFilePath, "listeners/listener_positional_port.yaml");
104104
}
105105

106106
@Test(description = "Generate OpenAPI spec for listener with positional port arguments")
107107
public void testListenerWithNamedPortAndHost() throws IOException {
108-
Path ballerinaFilePAth = RES_DIR.resolve("listeners/listener_named_port_and_host.bal");
109-
TestUtils.compareWithGeneratedFile(ballerinaFilePAth, "listeners/listener_named_port_and_host.yaml");
108+
Path ballerinaFilePath = RES_DIR.resolve("listeners/listener_named_port_and_host.bal");
109+
TestUtils.compareWithGeneratedFile(ballerinaFilePath, "listeners/listener_named_port_and_host.yaml");
110110
}
111111

112112
@Test(description = "Generate OpenAPI spec for listener with positional port arguments")
113113
public void testListenerWithNamedPortAndHostInConfig() throws IOException {
114-
Path ballerinaFilePAth = RES_DIR.resolve("listeners/listener_named_port_host_config.bal");
115-
TestUtils.compareWithGeneratedFile(ballerinaFilePAth, "listeners/listener_named_port_host_config.yaml");
114+
Path ballerinaFilePath = RES_DIR.resolve("listeners/listener_named_port_host_config.bal");
115+
TestUtils.compareWithGeneratedFile(ballerinaFilePath, "listeners/listener_named_port_host_config.yaml");
116116
}
117117

118118
@AfterMethod

0 commit comments

Comments
 (0)