Skip to content

Commit

Permalink
Fix integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
rathnapandi committed Nov 14, 2023
1 parent daf5112 commit fd58cd7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonInclude;
import org.apache.commons.io.IOUtils;
import org.testng.annotations.Optional;
import org.testng.annotations.Parameters;
Expand Down Expand Up @@ -40,7 +41,8 @@ public class RoutePolicyOnlyTestIT extends TestNGCitrusTestRunner {
@Test @Parameters("context")
public void run(@Optional @CitrusResource TestContext context) throws IOException {
ObjectMapper mapper = new ObjectMapper();

mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
swaggerExport = new ExportTestAction();
swaggerImport = new ImportTestAction();
description("Import an API including a Routing-Policy to export it afterwards");
Expand Down Expand Up @@ -84,6 +86,10 @@ public void run(@Optional @CitrusResource TestContext context) throws IOExceptio


List<SecurityProfile> importedSecurityProfiles = mapper.convertValue(importedAPIConfig.get("securityProfiles"), new TypeReference<List<SecurityProfile>>(){});

// ignore empty values in properties
importedSecurityProfiles = mapper.readValue(mapper.writeValueAsString(importedSecurityProfiles), new TypeReference<List<SecurityProfile>>() {
});
List<SecurityProfile> exportedSecurityProfiles = mapper.convertValue(exportedAPIConfig.get("securityProfiles"), new TypeReference<List<SecurityProfile>>(){});
assertEquals(importedSecurityProfiles, exportedSecurityProfiles, "SecurityProfiles are not equal.");

Expand Down

0 comments on commit fd58cd7

Please sign in to comment.