Skip to content

Commit

Permalink
feat: add test cases for all objects and all opertions (#68)
Browse files Browse the repository at this point in the history
* add:ApplicationTest.java add test cases for user、application objects and user、application operations

* fix:update ApplicationTest and add TestDefaultConfig

* fix: add test case for application
Slimmed down the files starting with Casdoor, removed the corresponding toString method, and changed the permission modifier to public.

* feat: add test cases for all objects and all opertions
feat: Add test for all object
  • Loading branch information
WindyDante authored Oct 14, 2023
1 parent c761a42 commit 01164db
Show file tree
Hide file tree
Showing 50 changed files with 948 additions and 1,665 deletions.
60 changes: 6 additions & 54 deletions src/main/java/org/casbin/casdoor/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
* The first step to use this SDK is to initialize the global casdoorConfig.
*/
public class Config {
private String endpoint;
private String clientId;
private String clientSecret;
private String certificate;
private String organizationName;
private String applicationName;
public String endpoint;
public String clientId;
public String clientSecret;
public String certificate;
public String organizationName;
public String applicationName;

public Config() {
}
Expand All @@ -38,52 +38,4 @@ public Config(String endpoint, String clientId, String clientSecret, String cert
this.applicationName = applicationName;
}

public String getEndpoint() {
return endpoint;
}

public void setEndpoint(String endpoint) {
this.endpoint = endpoint;
}

public String getClientId() {
return clientId;
}

public void setClientId(String clientId) {
this.clientId = clientId;
}

public String getClientSecret() {
return clientSecret;
}

public void setClientSecret(String clientSecret) {
this.clientSecret = clientSecret;
}

public String getCertificate() {
return certificate;
}

public void setCertificate(String certificate) {
this.certificate = certificate;
}

public String getOrganizationName() {
return organizationName;
}

public void setOrganizationName(String organizationName) {
this.organizationName = organizationName;
}

public String getApplicationName() {
return applicationName;
}

public void setApplicationName(String applicationName) {
this.applicationName = applicationName;
}

}
99 changes: 5 additions & 94 deletions src/main/java/org/casbin/casdoor/entity/Cert.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,113 +27,24 @@ public class Cert implements Serializable {
public int bitSize;
public int expireInYears;
public String certificate;

public Cert() {
}

public String privateKey;
public String authorityPublicKey;
public String authorityRootPublicKey;

public String getOwner() {
return owner;
}

public void setOwner(String owner) {
public Cert(String owner, String name, String createdTime, String displayName, String scope, String type, String cryptoAlgorithm, int bitSize, int expireInYears) {
this.owner = owner;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getCreatedTime() {
return createdTime;
}

public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}

public String getDisplayName() {
return displayName;
}

public void setDisplayName(String displayName) {
this.displayName = displayName;
}

public String getScope() {
return scope;
}

public void setScope(String scope) {
this.scope = scope;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public String getCryptoAlgorithm() {
return cryptoAlgorithm;
}

public void setCryptoAlgorithm(String cryptoAlgorithm) {
this.cryptoAlgorithm = cryptoAlgorithm;
}

public int getBitSize() {
return bitSize;
}

public void setBitSize(int bitSize) {
this.bitSize = bitSize;
}

public int getExpireInYears() {
return expireInYears;
}

public void setExpireInYears(int expireInYears) {
this.expireInYears = expireInYears;
}

public String getCertificate() {
return certificate;
}

public void setCertificate(String certificate) {
this.certificate = certificate;
}

public String getPrivateKey() {
return privateKey;
}

public void setPrivateKey(String privateKey) {
this.privateKey = privateKey;
}

public String getAuthorityPublicKey() {
return authorityPublicKey;
}

public void setAuthorityPublicKey(String authorityPublicKey) {
this.authorityPublicKey = authorityPublicKey;
}

public String getAuthorityRootPublicKey() {
return authorityRootPublicKey;
}

public void setAuthorityRootPublicKey(String authorityRootPublicKey) {
this.authorityRootPublicKey = authorityRootPublicKey;
}


}
32 changes: 0 additions & 32 deletions src/main/java/org/casbin/casdoor/entity/EmailForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,37 +33,5 @@ public EmailForm(String title, String content, String sender, String[] receivers
this.sender = sender;
this.receivers = receivers;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getContent() {
return content;
}

public void setContent(String content) {
this.content = content;
}

public String getSender() {
return sender;
}

public void setSender(String sender) {
this.sender = sender;
}

public String[] getReceivers() {
return receivers;
}

public void setReceivers(String[] receivers) {
this.receivers = receivers;
}

}
73 changes: 11 additions & 62 deletions src/main/java/org/casbin/casdoor/entity/Organization.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,77 +15,26 @@
package org.casbin.casdoor.entity;

public class Organization {
public String owner, name, createdTime, displayName, websiteUrl, favicon, passwordType, passwordSalt, phonePrefix;
public String owner;
public String name;
public String createdTime;
public String displayName;
public String websiteUrl;

public String getOwner() {
return owner;
public Organization() {
}

public void setOwner(String owner) {
public Organization(String owner, String name, String createdTime, String displayName, String websiteUrl, String passwordType) {
this.owner = owner;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getCreatedTime() {
return createdTime;
}

public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}

public String getDisplayName() {
return displayName;
}

public void setDisplayName(String displayName) {
this.displayName = displayName;
}

public String getWebsiteUrl() {
return websiteUrl;
}

public void setWebsiteUrl(String websiteUrl) {
this.websiteUrl = websiteUrl;
}

public String getFavicon() {
return favicon;
}

public void setFavicon(String favicon) {
this.favicon = favicon;
}

public String getPasswordType() {
return passwordType;
}

public void setPasswordType(String passwordType) {
this.passwordType = passwordType;
}

public String getPasswordSalt() {
return passwordSalt;
}

public void setPasswordSalt(String passwordSalt) {
this.passwordSalt = passwordSalt;
}

public String getPhonePrefix() {
return phonePrefix;
}

public void setPhonePrefix(String phonePrefix) {
this.phonePrefix = phonePrefix;
}
public String favicon;
public String passwordType;
public String passwordSalt;
public String phonePrefix;
}
Loading

0 comments on commit 01164db

Please sign in to comment.