Skip to content

Commit

Permalink
Include characters that need to be url encoded in test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
NewAgeCZ committed Mar 5, 2023
1 parent 147d50f commit 53d513f
Showing 1 changed file with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import com.netflix.discovery.shared.Applications;
import com.netflix.discovery.shared.transport.EurekaHttpClient;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

import org.springframework.http.HttpStatus;

Expand All @@ -46,9 +48,10 @@ void testCancel() {
assertThat(eurekaHttpClient.cancel("test", "test").getStatusCode()).isEqualTo(HttpStatus.OK.value());
}

@Test
void testSendHeartBeat() {
assertThat(eurekaHttpClient.sendHeartBeat("test", "test", info, null).getStatusCode())
@ParameterizedTest
@ValueSource(strings = { "test", "test#1.[3.?]!"})
void testSendHeartBeat(String instanceId) {
assertThat(eurekaHttpClient.sendHeartBeat("test", instanceId, info, null).getStatusCode())
.isEqualTo(HttpStatus.OK.value());
}

Expand All @@ -58,10 +61,12 @@ void testSendHeartBeatFourOFour() {
.isEqualTo(HttpStatus.NOT_FOUND.value());
}

@Test
void testStatusUpdate() {
assertThat(eurekaHttpClient.statusUpdate("test", "test", InstanceInfo.InstanceStatus.UP, info).getStatusCode())
.isEqualTo(HttpStatus.OK.value());
@ParameterizedTest
@ValueSource(strings = { "test", "test#1.[3.?]!"})
void testStatusUpdate(String instanceId) {
assertThat(
eurekaHttpClient.statusUpdate("test", instanceId, InstanceInfo.InstanceStatus.UP, info).getStatusCode())
.isEqualTo(HttpStatus.OK.value());
}

@Test
Expand Down Expand Up @@ -100,10 +105,11 @@ void testGetApplication() {
eurekaHttpClient.getApplication("test");
}

@Test
void testGetInstance() {
eurekaHttpClient.getInstance("test");
eurekaHttpClient.getInstance("test", "test");
@ParameterizedTest
@ValueSource(strings = { "test", "test#1.[3.?]!"})
void testGetInstance(String instanceId) {
eurekaHttpClient.getInstance(instanceId);
eurekaHttpClient.getInstance("test", instanceId);
}

}

0 comments on commit 53d513f

Please sign in to comment.