-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ead35b5
commit f295925
Showing
7 changed files
with
93 additions
and
120 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
modules/apim-adapter/src/test/java/com/axway/apim/api/APITest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.axway.apim.api; | ||
|
||
import com.fasterxml.jackson.databind.JsonNode; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
import java.io.IOException; | ||
|
||
public class APITest { | ||
|
||
private static final String testPackage = "com/axway/apim/model/"; | ||
|
||
ObjectMapper mapper = new ObjectMapper(); | ||
|
||
@Test | ||
public void parseResponseHavingCreatedOn() throws IOException { | ||
JsonNode jsonNode = mapper.readTree(this.getClass().getClassLoader().getResourceAsStream(testPackage + "BEAPICreatedWithCreatedOn.json")); | ||
API createdAPI = new API(); | ||
createdAPI.setApiId(jsonNode.get("id").asText()); | ||
createdAPI.setName(jsonNode.get("name").asText()); | ||
createdAPI.setName(jsonNode.get("description").asText()); | ||
|
||
createdAPI.setCreatedOn(Long.parseLong(jsonNode.get("createdOn").asText())); | ||
|
||
Assert.assertEquals(1605099396581L, createdAPI.getCreatedOn().longValue()); | ||
// Tests if the Unicode-Description is parsed without giving a encoding | ||
Assert.assertEquals("提供銀行身份認證整合 Axway APIM OAuth Authorization Code Grant Flow\n", jsonNode.get("description").asText()); | ||
} | ||
} |
109 changes: 63 additions & 46 deletions
109
modules/apim-adapter/src/test/java/com/axway/apim/api/model/OutboundProfileTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
31 changes: 0 additions & 31 deletions
31
modules/apis/src/test/java/com/axway/apim/model/BEAPICreatedResponseTest.java
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
modules/apis/src/test/java/com/axway/apim/model/ConfigOutboundProfileTest.java
This file was deleted.
Oops, something went wrong.