Skip to content

Commit

Permalink
- Fix integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
rathnapandi committed Mar 12, 2024
1 parent 3ba49ca commit 77e76cf
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.axway.apim.EndpointConfig;
import com.axway.apim.TestUtils;
import com.axway.apim.adapter.APIManagerAdapter;
import com.axway.apim.api.model.apps.ClientApplication;
import com.axway.apim.appexport.ApplicationExportApp;
import com.axway.apim.appimport.ClientApplicationImportApp;
Expand Down Expand Up @@ -172,8 +173,13 @@ public void run(@Optional @CitrusResource TestContext context) throws IOExceptio
});
Assert.assertEquals(new File(tmpDirPath, appName).listFiles().length, 1, "Expected to have one application exported");
String exportedConfig = new File(tmpDirPath, appName).listFiles()[0].getPath();
ClientApplication exportedApp = mapper.readValue(new File(exportedConfig), ClientApplication.class);
Assert.assertNotNull(exportedApp.getPermissions(), "Exported client application must have permissions");
Assert.assertEquals(exportedApp.getPermissions().size(), 4, "Exported client application must have 4 permissions");
APIManagerAdapter apiManagerAdapter = APIManagerAdapter.getInstance();
try {
ClientApplication exportedApp = mapper.readValue(new File(exportedConfig), ClientApplication.class);
Assert.assertNotNull(exportedApp.getPermissions(), "Exported client application must have permissions");
Assert.assertEquals(exportedApp.getPermissions().size(), 4, "Exported client application must have 4 permissions");
}finally {
apiManagerAdapter.deleteInstance();
}
}
}

0 comments on commit 77e76cf

Please sign in to comment.