Skip to content

Commit

Permalink
chore: Remove unwanted numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
nbrouand committed Nov 25, 2024
1 parent a962e46 commit 3be2c39
Show file tree
Hide file tree
Showing 22 changed files with 76 additions and 76 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Here is an example of a scenario written in Kotlin ([source code](https://github

val root_list_all_resources =
Scenario(
id = 666000,
id = 123000,
title = "SWAPI - The Root resource provides information on all available resources",
tags = listOf(TAG)
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private void basicPublishForConsuming(MockConnectionFactory mockConnectionFactor
"test",
ImmutableMap.of("header1", value1, "header2", ImmutableList.of(value1, value2, value3)),
Collections.singletonMap("content_type", "application/json"),
"{\"value\": \"test message\", \"id\": \"999999\"}",
"{\"value\": \"test message\", \"id\": \"456456\"}",
logger
), mockConnectionFactory);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void should_create_connection_from_target_addresses_property() throws Exception
Target target = TestTarget.TestTargetBuilder.builder()
.withTargetId("target with adresses property")
.withUrl("scheme://host:888")
.withProperty("addresses", "localhost:666,localhost:999")
.withProperty("addresses", "localhost:123,localhost:456")
.build();

// When
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,24 +421,24 @@ Stream<Arguments> lenientEqual() {
Arguments.of("{}", null, Success),
Arguments.of("[1, \"value\"]", null, Success),
Arguments.of("{\"string\": \"value\"}", null, Success),
Arguments.of("{\"number\": 666}", null, Success),
Arguments.of("{\"number\": 123}", null, Success),
Arguments.of("{\"array\": [1, 2, 3]}", null, Success),
Arguments.of("{\"object\":{\"string\":\"value\"}}", null, Success),

// Extra attributes
Arguments.of("{\"number\": 666}", "{}", Success),
Arguments.of("{\"number\": 123}", "{}", Success),
Arguments.of("{\"string\": \"val\"}", "{}", Success),
Arguments.of("{\"array\": [666, \"val\", {\"att\": \"val\"}]}", "{}", Success),
Arguments.of("{\"array\": [123, \"val\", {\"att\": \"val\"}]}", "{}", Success),
Arguments.of("{\"object\": {\"att\": \"val\"}}", "{}", Success),

Arguments.of("{\"string\": \"val\", \"extra_number\": 666}", "{\"string\": \"val\"}", Success),
Arguments.of("{\"string\": \"val\", \"extra_number\": 123}", "{\"string\": \"val\"}", Success),
Arguments.of("{\"string\": \"val\", \"extra_string\": \"value\"}", "{\"string\": \"val\"}", Success),
Arguments.of("{\"string\": \"val\", \"extra_array\": [666, \"val\", {\"att\": \"val\"}]}", "{\"string\": \"val\"}", Success),
Arguments.of("{\"string\": \"val\", \"extra_array\": [123, \"val\", {\"att\": \"val\"}]}", "{\"string\": \"val\"}", Success),
Arguments.of("{\"string\": \"val\", \"extra_object\": {\"att\": \"val\"}}", "{\"string\": \"val\"}", Success),

Arguments.of("{\"object\": {\"att\": \"val\", \"extra_att\": \"extra_val\"}}", "{\"object\": {\"att\": \"val\"}}", Success),

Arguments.of("{\"string\": \"val\", \"extra_number_one\": 666}", "{\"string\": \"val\", \"extra_number_two\": 666}", Failure),
Arguments.of("{\"string\": \"val\", \"extra_number_one\": 123}", "{\"string\": \"val\", \"extra_number_two\": 123}", Failure),
Arguments.of("{\"string\": \"val\", \"object\": {\"att\": \"val\", \"extra_att_one\": \"val\"}}", "{\"string\": \"val\", \"object\": {\"att\": \"val\", \"extra_att_two\": \"val\"}}", Failure),

// Array order
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Stream<Arguments> classic_equals() {
Arguments.of("{}"),
Arguments.of("[1, \"value\"]"),
Arguments.of("{\"string\": \"value\"}"),
Arguments.of("{\"number\": 666}"),
Arguments.of("{\"number\": 123}"),
Arguments.of("{\"array\": [1, 2, 3]}"),
Arguments.of("{\"object\":{\"string\":\"value\"}}")
);
Expand All @@ -143,19 +143,19 @@ void lenient_should_be_ok_with_extra_attributes_for_one_document_only(String doc

Stream<Arguments> extra_attributes() {
return Stream.of(
Arguments.of("{}", "{\"number\": 666}", Success),
Arguments.of("{}", "{\"number\": 123}", Success),
Arguments.of("{\"string\": \"val\"}", "{}", Success),
Arguments.of("{}", "{\"array\": [666, \"val\", {\"att\": \"val\"}]}", Success),
Arguments.of("{}", "{\"array\": [123, \"val\", {\"att\": \"val\"}]}", Success),
Arguments.of("{\"object\": {\"att\": \"val\"}}", "{}", Success),

Arguments.of("{\"string\": \"val\"}", "{\"string\": \"val\", \"extra_number\": 666}", Success),
Arguments.of("{\"string\": \"val\"}", "{\"string\": \"val\", \"extra_number\": 123}", Success),
Arguments.of("{\"string\": \"val\"}", "{\"string\": \"val\", \"extra_string\": \"value\"}", Success),
Arguments.of("{\"string\": \"val\"}", "{\"string\": \"val\", \"extra_array\": [666, \"val\", {\"att\": \"val\"}]}", Success),
Arguments.of("{\"string\": \"val\"}", "{\"string\": \"val\", \"extra_array\": [123, \"val\", {\"att\": \"val\"}]}", Success),
Arguments.of("{\"string\": \"val\"}", "{\"string\": \"val\", \"extra_object\": {\"att\": \"val\"}}", Success),

Arguments.of("{\"object\": {\"att\": \"val\"}}", "{\"object\": {\"att\": \"val\", \"extra_att\": \"extra_val\"}}", Success),

Arguments.of("{\"string\": \"val\", \"extra_number_one\": 666}", "{\"string\": \"val\", \"extra_number_two\": 666}", Failure),
Arguments.of("{\"string\": \"val\", \"extra_number_one\": 123}", "{\"string\": \"val\", \"extra_number_two\": 123}", Failure),
Arguments.of("{\"string\": \"val\", \"object\": {\"att\": \"val\", \"extra_att_one\": \"val\"}}", "{\"string\": \"val\", \"object\": {\"att\": \"val\", \"extra_att_two\": \"val\"}}", Failure)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@ public void should_select_message_whose_headers_match_given_payload_jsonpath_sel
// Given
ImmutableList<Header> headers = ImmutableList.of(
new RecordHeader("X-Custom-HeaderKey", "X-Custom-HeaderValue".getBytes()),
new RecordHeader("header", "666".getBytes())
new RecordHeader("header", "123".getBytes())
);
Action action = givenKafkaConsumeAction(3, null, "$..[?($.header=='666')]", null, null);
Action action = givenKafkaConsumeAction(3, null, "$..[?($.header=='123')]", null, null);
String textMessageToSelect = "first text message";
String xmlMessageToSelect = "<root>first xml message</root>";
String jsonMessageToSelect = "first json message";
Expand Down Expand Up @@ -392,10 +392,10 @@ public void should_select_message_whose_headers_match_given_payload_jsonpath_sel
public void should_consume_message_with_duplicated_header_pair_key_value() {
// Given
ImmutableList<Header> headers = ImmutableList.of(
new RecordHeader("header", "666".getBytes()),
new RecordHeader("header", "666".getBytes())
new RecordHeader("header", "123".getBytes()),
new RecordHeader("header", "123".getBytes())
);
Action action = givenKafkaConsumeAction(1, null, "$..[?($.header=='666')]", null, null);
Action action = givenKafkaConsumeAction(1, null, "$..[?($.header=='123')]", null, null);
String textMessageToSelect = "first text message";
givenActionReceiveMessages(action,
buildRecord(FIRST_OFFSET, "KEY1", textMessageToSelect, headers),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ class BootstrapServersConfig {
@DisplayName("from configuration")
void should_use_configuration_for_bootstrap_servers_kafka_client_configuration() {
Target target = targetWithoutProperties
.withProperty(BOOTSTRAP_SERVERS_CONFIG, "target.host:6666")
.withProperty(BOOTSTRAP_SERVERS_CONFIG, "target.host:1236")
.build();

Map<String, String> config = Map.of(BOOTSTRAP_SERVERS_CONFIG, "conf.host:9999");
Map<String, String> config = Map.of(BOOTSTRAP_SERVERS_CONFIG, "conf.host:4567");

ConsumerFactory<String, String> consumerFactoryFactory = new KafkaConsumerFactoryFactory().create(target, "", config);

Expand All @@ -55,7 +55,7 @@ void should_use_configuration_for_bootstrap_servers_kafka_client_configuration()
@DisplayName("from target properties")
void should_use_target_properties_for_bootstrap_servers_kafka_client_configuration() {
Target target = targetWithoutProperties
.withProperty(BOOTSTRAP_SERVERS_CONFIG, "target.host:6666")
.withProperty(BOOTSTRAP_SERVERS_CONFIG, "target.host:1236")
.build();

ConsumerFactory<String, String> consumerFactoryFactory = new KafkaConsumerFactoryFactory().create(target, "", emptyMap());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ void update_jira_configuration_before_each_api_calls() throws Exception {
jiraConfigurationField.setAccessible(true);

// When empty initial configuration
assertThatThrownBy(() -> sut.getTestExecutionScenarios("NOP-666"))
assertThatThrownBy(() -> sut.getTestExecutionScenarios("NOP-123"))
.isInstanceOf(NoJiraConfigurationException.class);

assertThat(jiraConfigurationField.get(sut)).isEqualTo(initialJiraConfiguration);

// When new configuration
var newJiraConfiguration = new JiraServerConfiguration("http://jira.server", "", "", null, null, null);
when(jiraRepository.loadServerConfiguration()).thenReturn(newJiraConfiguration);
sut.getTestExecutionScenarios("NOP-666");
sut.getTestExecutionScenarios("NOP-123");

assertThat(jiraConfigurationField.get(sut)).isEqualTo(newJiraConfiguration);
verify(jiraXrayApi).getTestExecutionScenarios("NOP-666");
verify(jiraXrayApi).getTestExecutionScenarios("NOP-123");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void update_xray_execution() {
@Test
void test_issue_as_test_plan() {
// Given
String issueId = "PRJ-666";
String issueId = "PRJ-123";

var config = new JiraServerConfiguration(
"http://fake-server-jira",
Expand All @@ -87,7 +87,7 @@ void test_issue_as_test_plan() {
sut.isTestPlan(issueId)
)
.isExactlyInstanceOf(RuntimeException.class)
.hasMessage("Unable to get issue [PRJ-666] : ")
.hasMessage("Unable to get issue [PRJ-123] : ")
.hasRootCauseExactlyInstanceOf(UnknownHostException.class);
}

Expand Down Expand Up @@ -149,7 +149,7 @@ void update_xray_execution() {
@Test
void test_issue_as_test_plan() {
// Given
String issueId = "PRJ-666";
String issueId = "PRJ-123";

var config = new JiraServerConfiguration(
"http://fake-server-jira",
Expand Down Expand Up @@ -268,7 +268,7 @@ void update_xray_execution() {
@Test
void test_issue_as_test_plan() {
// Given
String issueId = "PRJ-666";
String issueId = "PRJ-123";

var config = new JiraServerConfiguration(
"http://fake-server-jira",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ private ExecutionHistory.Execution stubHistoryExecution(String scenarioId, long
.time(now())
.status(ServerReportStatus.SUCCESS)
.executionId(executionId)
.duration(666L)
.duration(123L)
.report("")
.testCaseTitle("fake")
.environment("")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
</insert>
<insert tableName="CAMPAIGN_SCENARIOS">
<column name="CAMPAIGN_ID" valueNumeric="1"/>
<column name="SCENARIO_ID" value="16-666"/>
<column name="SCENARIO_ID" value="16-123"/>
<column name="INDEX" valueNumeric="2"/>
</insert>
<insert tableName="CAMPAIGN_SCENARIOS">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ private static Object[] securedEndPointList() {
{POST, "/api/ui/campaign/v1", "CAMPAIGN_WRITE", "{\"title\":\"secu\",\"description\":\"desc\",\"scenarios\":[],\"tags\":[]}", BAD_REQUEST},
{POST, "/api/ui/campaign/v1", "CAMPAIGN_WRITE", "{\"title\":\"secu\",\"description\":\"desc\",\"scenarios\":[],\"tags\":[],\"environment\":\"ENV\"}", OK},
{PUT, "/api/ui/campaign/v1", "CAMPAIGN_WRITE", "{\"title\":\"secu\",\"description\":\"desc\",\"scenarios\":[],\"tags\":[],\"environment\":\"ENV\"}", OK},
{DELETE, "/api/ui/campaign/v1/666", "CAMPAIGN_WRITE", null, OK},
{GET, "/api/ui/campaign/v1/666", "CAMPAIGN_READ", null, NOT_FOUND},
{GET, "/api/ui/campaign/v1/666/scenarios", "CAMPAIGN_READ", null, NOT_FOUND},
{DELETE, "/api/ui/campaign/v1/123", "CAMPAIGN_WRITE", null, OK},
{GET, "/api/ui/campaign/v1/123", "CAMPAIGN_READ", null, NOT_FOUND},
{GET, "/api/ui/campaign/v1/123/scenarios", "CAMPAIGN_READ", null, NOT_FOUND},
{GET, "/api/ui/campaign/v1", "CAMPAIGN_READ", null, OK},
{GET, "/api/ui/campaign/v1/lastexecutions/20", "CAMPAIGN_READ", null, OK},
{GET, "/api/ui/campaign/v1/scenario/scenarioId", "SCENARIO_READ", null, OK},
Expand All @@ -117,16 +117,16 @@ private static Object[] securedEndPointList() {
"""
{"id":1,"schedulingDate":[2024,10,12,14,30,45],"frequency":"Daily","environment":"PROD","campaignsId":[1],"campaignsTitle":["title"],"datasetsId":["datasetId"]}
""", OK},
{DELETE, "/api/ui/campaign/v1/scheduling/666", "CAMPAIGN_WRITE", null, OK},
{DELETE, "/api/ui/campaign/v1/scheduling/123", "CAMPAIGN_WRITE", null, OK},

{GET, "/api/ui/campaign/execution/v1/campaignName", "CAMPAIGN_EXECUTE", null, OK},
{GET, "/api/ui/campaign/execution/v1/campaignName/DEFAULT", "CAMPAIGN_EXECUTE", null, OK},
{POST, "/api/ui/campaign/execution/v1/replay/666", "CAMPAIGN_EXECUTE", "{}", NOT_FOUND},
{POST, "/api/ui/campaign/execution/v1/replay/123", "CAMPAIGN_EXECUTE", "{}", NOT_FOUND},
{GET, "/api/ui/campaign/execution/v1/campaignPattern/surefire", "CAMPAIGN_EXECUTE", null, OK},
{GET, "/api/ui/campaign/execution/v1/campaignPattern/surefire/DEFAULT", "CAMPAIGN_EXECUTE", null, OK},
{POST, "/api/ui/campaign/execution/v1/666/stop", "CAMPAIGN_EXECUTE", "{}", NOT_FOUND},
{POST, "/api/ui/campaign/execution/v1/byID/666", "CAMPAIGN_EXECUTE", "{}", NOT_FOUND},
{POST, "/api/ui/campaign/execution/v1/byID/666/DEFAULT", "CAMPAIGN_EXECUTE", "{}", NOT_FOUND},
{POST, "/api/ui/campaign/execution/v1/123/stop", "CAMPAIGN_EXECUTE", "{}", NOT_FOUND},
{POST, "/api/ui/campaign/execution/v1/byID/123", "CAMPAIGN_EXECUTE", "{}", NOT_FOUND},
{POST, "/api/ui/campaign/execution/v1/byID/123/DEFAULT", "CAMPAIGN_EXECUTE", "{}", NOT_FOUND},
{GET, "/api/ui/campaign/v1/execution/1", "CAMPAIGN_READ", null, NOT_FOUND},

{GET, "/api/v1/editions/testcases/testcaseId", "SCENARIO_READ", null, OK},
Expand Down Expand Up @@ -170,16 +170,16 @@ private static Object[] securedEndPointList() {
{POST, "/api/scenario/execution/v1", "SCENARIO_EXECUTE", "{\"scenario\":{},\"environment\": {\"name\":\"env\"}}", OK},

{GET, "/api/ui/scenario/123/execution/v1", "SCENARIO_READ", null, OK},
{GET, "/api/ui/scenario/123/execution/666/v1", "SCENARIO_READ", null, NOT_FOUND},
{GET, "/api/ui/scenario/execution/666/summary/v1", "SCENARIO_READ", null, NOT_FOUND},
{GET, "/api/ui/scenario/123/execution/123/v1", "SCENARIO_READ", null, NOT_FOUND},
{GET, "/api/ui/scenario/execution/123/summary/v1", "SCENARIO_READ", null, NOT_FOUND},
{POST, "/api/ui/scenario/execution/v1/scenarioId/secuenv", "SCENARIO_EXECUTE", null, NOT_FOUND},
{POST, "/api/idea/scenario/execution/DEFAULT", "SCENARIO_EXECUTE", "{\"content\":\"{\\\"when\\\":{}}\",\"params\":{}} ", OK},
{POST, "/api/ui/scenario/executionasync/v1/scenarioId/DEFAULT", "SCENARIO_EXECUTE", null, NOT_FOUND},
{POST, "/api/ui/scenario/executionasync/v1/scenarioId/DEFAULT/DATASET", "SCENARIO_EXECUTE", "[]", NOT_FOUND},
{GET, "/api/ui/scenario/executionasync/v1/scenarioId/execution/666", "SCENARIO_READ", null, NOT_FOUND},
{POST, "/api/ui/scenario/executionasync/v1/scenarioId/execution/666/stop", "SCENARIO_EXECUTE", null, NOT_FOUND},
{POST, "/api/ui/scenario/executionasync/v1/scenarioId/execution/666/pause", "SCENARIO_EXECUTE", null, NOT_FOUND},
{POST, "/api/ui/scenario/executionasync/v1/scenarioId/execution/666/resume", "SCENARIO_EXECUTE", null, NOT_FOUND},
{GET, "/api/ui/scenario/executionasync/v1/scenarioId/execution/123", "SCENARIO_READ", null, NOT_FOUND},
{POST, "/api/ui/scenario/executionasync/v1/scenarioId/execution/123/stop", "SCENARIO_EXECUTE", null, NOT_FOUND},
{POST, "/api/ui/scenario/executionasync/v1/scenarioId/execution/123/pause", "SCENARIO_EXECUTE", null, NOT_FOUND},
{POST, "/api/ui/scenario/executionasync/v1/scenarioId/execution/123/resume", "SCENARIO_EXECUTE", null, NOT_FOUND},

{POST, "/api/v1/authorizations", "ADMIN_ACCESS", "{}", OK},
{GET, "/api/v1/authorizations", "ADMIN_ACCESS", null, OK},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void start_scenario_execution() {
ExecutionHistory.Execution scenarioExecution = mock(ExecutionHistory.Execution.class);
when(scenarioExecution.scenarioId()).thenReturn(testCase.metadata().id());
when(scenarioExecution.testCaseTitle()).thenReturn(testCase.metadata().title());
when(scenarioExecution.executionId()).thenReturn(666L);
when(scenarioExecution.executionId()).thenReturn(123L);
when(scenarioExecution.dataset()).thenReturn(Optional.of(campaignReport.dataset));

campaignReport.updateScenarioExecutionId(scenarioExecution);
Expand All @@ -192,7 +192,7 @@ void start_scenario_execution() {
assertThat(report.scenarioId()).isEqualTo(testCase.metadata().id());
assertThat(report.scenarioName()).isEqualTo(testCase.metadata().title());
assertThat(report.execution()).satisfies(executionSummary -> {
assertThat(executionSummary.executionId()).isEqualTo(666L);
assertThat(executionSummary.executionId()).isEqualTo(123L);
assertThat(executionSummary.time()).isAfter(beforeStartExecution);
assertThat(executionSummary.status()).isEqualTo(RUNNING);
assertThat(executionSummary.environment()).isEqualTo("env");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public void should_find_no_campaign_related_to_an_orphan_scenario() {
sut.createOrUpdate(campaign1);

// When
List<Campaign> scenarioCampaigns = sut.findCampaignsByScenarioId(String.valueOf(s1.getId() + 666));
List<Campaign> scenarioCampaigns = sut.findCampaignsByScenarioId(String.valueOf(s1.getId() + 123));

// Then
Assertions.assertThat(scenarioCampaigns).isEmpty();
Expand Down
Loading

0 comments on commit 3be2c39

Please sign in to comment.