Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0.x] test: fix failing tests due to the new syncFrom property #7416

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,46 @@ public void createAndDeleteApiTest() throws Exception {
}

@Test
<<<<<<< HEAD
=======
public void createAndDeleteFederatedApiTest() throws Exception {
String apiId = "newApi-Id";

var api = Api
.builder()
.id(apiId)
.environmentId("DEFAULT")
.origin("integration")
.integrationId("integration-id")
.name("A Federated API")
.description("federated-api-description")
.definition("{}")
.version("1.0")
.visibility(PRIVATE)
.createdAt(parse("11/02/2024"))
.updatedAt(parse("11/02/2024"))
.lifecycleState(null)
.mode(null)
.labels(List.of())
.categories(Set.of())
.groups(Set.of())
.apiLifecycleState(CREATED)
.syncFrom("MANAGEMENT")
.build();
apiRepository.create(api);

assertThat(apiRepository.findById(apiId))
.isPresent()
.get()
.satisfies(result -> assertThat(result).usingRecursiveComparison().isEqualTo(api));

// test delete
apiRepository.delete(apiId);
assertThat(apiRepository.findById(apiId)).isEmpty();
}

@Test
>>>>>>> 73eab884f1 (test: fix failing tests due to the new syncFrom property)
public void shouldUpdate() throws Exception {
Optional<Api> optional = apiRepository.findById("api-to-update");
assertTrue("API to update not found", optional.isPresent());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"crossId": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"definition_context": {
"origin": "kubernetes",
"mode": "fully_managed"
"mode": "fully_managed",
"syncFrom": "kubernetes"
},
"name": "test kubernetes",
"version": "1",
Expand Down