From 441c1107aa3772bdd21f125c4f9be6c624cfcb45 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Fri, 9 Sep 2016 17:28:40 +0200 Subject: [PATCH] correct wording (#1230) adress -> address 127.0.1 -> 127.0.0.1 --- .../it/serverSystem/ServerSystemTest.java | 4 +-- .../sonar/server/serverid/ws/ShowAction.java | 6 ++-- .../server/serverid/ws/show-example.json | 6 ++-- .../server/serverid/ws/ShowActionTest.java | 30 +++++++++---------- .../js/apps/settings/serverId/ServerIdApp.js | 4 +-- sonar-ws/src/main/protobuf/ws-serverid.proto | 2 +- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/it/it-tests/src/test/java/it/serverSystem/ServerSystemTest.java b/it/it-tests/src/test/java/it/serverSystem/ServerSystemTest.java index fe919bb7e71..31cc93a4c44 100644 --- a/it/it-tests/src/test/java/it/serverSystem/ServerSystemTest.java +++ b/it/it-tests/src/test/java/it/serverSystem/ServerSystemTest.java @@ -254,7 +254,7 @@ public class ServerSystemTest { WsClient adminWsClient = newAdminWsClient(orchestrator); ShowWsResponse response = ShowWsResponse.parseFrom(adminWsClient.wsConnector().call( new GetRequest("api/server_id/show").setMediaType(MediaTypes.PROTOBUF)).contentStream()); - assertThat(response.getValidIpAdressesCount()).isGreaterThan(0); - return response.getValidIpAdresses(0); + assertThat(response.getValidIpAddressesCount()).isGreaterThan(0); + return response.getValidIpAddresses(0); } } diff --git a/server/sonar-server/src/main/java/org/sonar/server/serverid/ws/ShowAction.java b/server/sonar-server/src/main/java/org/sonar/server/serverid/ws/ShowAction.java index e65bbcc22e1..5230714dda4 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/serverid/ws/ShowAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/serverid/ws/ShowAction.java @@ -86,9 +86,9 @@ public class ShowAction implements ServerIdWsAction { private ShowWsResponse doHandle(Map properties) { ShowWsResponse.Builder responseBuilder = ShowWsResponse.newBuilder(); - List validIpAdresses = serverIdGenerator.getAvailableAddresses().stream().map(InetAddress::getHostAddress).collect(toList()); - if (!validIpAdresses.isEmpty()) { - responseBuilder.addAllValidIpAdresses(validIpAdresses); + List validIpAddresses = serverIdGenerator.getAvailableAddresses().stream().map(InetAddress::getHostAddress).collect(toList()); + if (!validIpAddresses.isEmpty()) { + responseBuilder.addAllValidIpAddresses(validIpAddresses); } Optional serverId = getSettingValue(properties.get(PERMANENT_SERVER_ID)); diff --git a/server/sonar-server/src/main/resources/org/sonar/server/serverid/ws/show-example.json b/server/sonar-server/src/main/resources/org/sonar/server/serverid/ws/show-example.json index bd00b32b768..1f2f3c1140d 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/serverid/ws/show-example.json +++ b/server/sonar-server/src/main/resources/org/sonar/server/serverid/ws/show-example.json @@ -1,9 +1,9 @@ { "serverId": "1818a1eefb26f9g", "organization": "home", - "ip": "127.0.1", - "validIpAdresses": [ + "ip": "127.0.0.1", + "validIpAddresses": [ "192.168.1.1", - "127.0.1" + "127.0.0.1" ] } diff --git a/server/sonar-server/src/test/java/org/sonar/server/serverid/ws/ShowActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/serverid/ws/ShowActionTest.java index fdbc861ae02..e534a183738 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/serverid/ws/ShowActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/serverid/ws/ShowActionTest.java @@ -70,23 +70,23 @@ public class ShowActionTest { @Test public void return_server_id_info() throws Exception { setUserAsSystemAdmin(); - when(generator.validate("home", "127.0.1", "1818a1eefb26f9g")).thenReturn(true); - setAvailableIpAdresses("192.168.1.1", "127.0.1"); - insertConfiguration("1818a1eefb26f9g", "home", "127.0.1"); + when(generator.validate("home", "127.0.0.1", "1818a1eefb26f9g")).thenReturn(true); + setAvailableIpAdresses("192.168.1.1", "127.0.0.1"); + insertConfiguration("1818a1eefb26f9g", "home", "127.0.0.1"); ShowWsResponse response = executeRequest(); assertThat(response.getServerId()).isEqualTo("1818a1eefb26f9g"); assertThat(response.getOrganization()).isEqualTo("home"); - assertThat(response.getIp()).isEqualTo("127.0.1"); - assertThat(response.getValidIpAdressesList()).containsOnly("192.168.1.1", "127.0.1"); + assertThat(response.getIp()).isEqualTo("127.0.0.1"); + assertThat(response.getValidIpAddressesList()).containsOnly("192.168.1.1", "127.0.0.1"); assertThat(response.hasInvalidServerId()).isFalse(); } @Test public void return_invalid_server_id() throws Exception { setUserAsSystemAdmin(); - when(generator.validate("home", "127.0.1", "1818a1eefb26f9g")).thenReturn(true); + when(generator.validate("home", "127.0.0.1", "1818a1eefb26f9g")).thenReturn(true); insertConfiguration("invalid", null, null); ShowWsResponse response = executeRequest(); @@ -95,7 +95,7 @@ public class ShowActionTest { assertThat(response.getServerId()).isEqualTo("invalid"); assertThat(response.hasOrganization()).isFalse(); assertThat(response.hasIp()).isFalse(); - assertThat(response.getValidIpAdressesList()).isEmpty(); + assertThat(response.getValidIpAddressesList()).isEmpty(); } @Test @@ -107,35 +107,35 @@ public class ShowActionTest { assertThat(response.hasServerId()).isFalse(); assertThat(response.hasOrganization()).isFalse(); assertThat(response.hasIp()).isFalse(); - assertThat(response.getValidIpAdressesList()).isEmpty(); + assertThat(response.getValidIpAddressesList()).isEmpty(); assertThat(response.hasInvalidServerId()).isFalse(); } @Test public void return_no_server_id_info_when_no_server_id_but_other_settings() throws Exception { setUserAsSystemAdmin(); - insertConfiguration(null, "home", "127.0.1"); + insertConfiguration(null, "home", "127.0.0.1"); ShowWsResponse response = executeRequest(); assertThat(response.hasServerId()).isFalse(); assertThat(response.hasOrganization()).isFalse(); assertThat(response.hasIp()).isFalse(); - assertThat(response.getValidIpAdressesList()).isEmpty(); + assertThat(response.getValidIpAddressesList()).isEmpty(); assertThat(response.hasInvalidServerId()).isFalse(); } @Test public void return_available_ips_even_if_no_settings() throws Exception { setUserAsSystemAdmin(); - setAvailableIpAdresses("192.168.1.1", "127.0.1"); + setAvailableIpAdresses("192.168.1.1", "127.0.0.1"); ShowWsResponse response = executeRequest(); assertThat(response.hasServerId()).isFalse(); assertThat(response.hasOrganization()).isFalse(); assertThat(response.hasIp()).isFalse(); - assertThat(response.getValidIpAdressesList()).containsOnly("192.168.1.1", "127.0.1"); + assertThat(response.getValidIpAddressesList()).containsOnly("192.168.1.1", "127.0.0.1"); assertThat(response.hasInvalidServerId()).isFalse(); } @@ -161,9 +161,9 @@ public class ShowActionTest { @Test public void test_example_json_response() { setUserAsSystemAdmin(); - when(generator.validate("home", "127.0.1", "1818a1eefb26f9g")).thenReturn(true); - setAvailableIpAdresses("192.168.1.1", "127.0.1"); - insertConfiguration("1818a1eefb26f9g", "home", "127.0.1"); + when(generator.validate("home", "127.0.0.1", "1818a1eefb26f9g")).thenReturn(true); + setAvailableIpAdresses("192.168.1.1", "127.0.0.1"); + insertConfiguration("1818a1eefb26f9g", "home", "127.0.0.1"); String result = ws.newRequest() .setMediaType(JSON) diff --git a/server/sonar-web/src/main/js/apps/settings/serverId/ServerIdApp.js b/server/sonar-web/src/main/js/apps/settings/serverId/ServerIdApp.js index 3a5e9a8ec2c..afeeca6c566 100644 --- a/server/sonar-web/src/main/js/apps/settings/serverId/ServerIdApp.js +++ b/server/sonar-web/src/main/js/apps/settings/serverId/ServerIdApp.js @@ -33,7 +33,7 @@ export default class ServerIdApp extends React.Component { loading: true, organization: '', ip: '', - validIpAdresses: [] + validIpAddresses: [] }; componentDidMount () { @@ -132,7 +132,7 @@ export default class ServerIdApp extends React.Component {
{translate('server_id_configuration.ip.desc')}
    - {this.state.validIpAdresses.map(ip => ( + {this.state.validIpAddresses.map(ip => (
  • {ip}
  • ))}
diff --git a/sonar-ws/src/main/protobuf/ws-serverid.proto b/sonar-ws/src/main/protobuf/ws-serverid.proto index af02b223d86..855a93889de 100644 --- a/sonar-ws/src/main/protobuf/ws-serverid.proto +++ b/sonar-ws/src/main/protobuf/ws-serverid.proto @@ -29,7 +29,7 @@ message ShowWsResponse { optional string serverId = 1; optional string organization = 2; optional string ip = 3; - repeated string validIpAdresses = 4; + repeated string validIpAddresses = 4; optional bool invalidServerId = 5; } -- 2.39.5