-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add other APIs and testing (#72)
* 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 * fix: add test for enforcer、group、model、payment Added entity classes and service methods for enforcer, group, model, and payment and wrote corresponding test methods to test them. * fix: Adding additional test methods Added methods for adding, deleting and retrieving other test objects * fix: add Apache license header and Modify public fields
- Loading branch information
1 parent
15052b6
commit 8bc9350
Showing
63 changed files
with
2,178 additions
and
117 deletions.
There are no files selected for viewing
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,22 @@ | ||
// Copyright 2023 The Casdoor Authors. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package org.casbin.casdoor.entity; | ||
|
||
public class AccountItem { | ||
public String name; | ||
public boolean visible; | ||
public String viewRule; | ||
public String modifyRule; | ||
} |
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,43 @@ | ||
// Copyright 2023 The Casdoor Authors. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package org.casbin.casdoor.entity; | ||
|
||
public class Adapter { | ||
public String owner; | ||
public String name; | ||
public String createdTime; | ||
public String type; | ||
public String databaseType; | ||
public String host; | ||
public int port; | ||
public String user; | ||
public String password; | ||
public String database; | ||
public String table; | ||
public String tableNamePrefix; | ||
public boolean isEnabled; | ||
|
||
|
||
public Adapter() { | ||
} | ||
|
||
public Adapter(String owner, String name, String createdTime, String user, String host) { | ||
this.owner = owner; | ||
this.name = name; | ||
this.createdTime = createdTime; | ||
this.host = host; | ||
this.user = user; | ||
} | ||
} |
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,20 @@ | ||
// Copyright 2023 The Casdoor Authors. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package org.casbin.casdoor.entity; | ||
|
||
public class MfaItem { | ||
public String name; | ||
public String rule; | ||
} |
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
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,42 @@ | ||
// Copyright 2023 The Casdoor Authors. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package org.casbin.casdoor.entity; | ||
|
||
import java.util.List; | ||
|
||
public class Plan { | ||
public String owner; | ||
public String name; | ||
public String createdTime; | ||
public String displayName; | ||
public String description; | ||
public double pricePerMonth; | ||
public double pricePerYear; | ||
public String currency; | ||
public boolean isEnabled; | ||
public String role; | ||
public List<String> options; | ||
|
||
public Plan(String owner, String name, String createdTime, String displayName, String description) { | ||
this.owner = owner; | ||
this.name = name; | ||
this.createdTime = createdTime; | ||
this.displayName = displayName; | ||
this.description = description; | ||
} | ||
|
||
public Plan() { | ||
} | ||
} |
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,65 @@ | ||
// Copyright 2023 The Casdoor Authors. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing CasdoorPermissions and | ||
// limitations under the License. | ||
|
||
package org.casbin.casdoor.entity; | ||
|
||
import java.util.List; | ||
|
||
public class Pricing { | ||
public String owner; | ||
|
||
public String name; | ||
|
||
public String createdTime; | ||
|
||
public String displayName; | ||
|
||
public String description; | ||
|
||
public List<String> plans; | ||
|
||
public boolean isEnabled; | ||
|
||
public int trialDuration; | ||
|
||
public String application; | ||
|
||
public String submitter; | ||
|
||
public String approver; | ||
|
||
public String approveTime; | ||
|
||
public String state; | ||
|
||
public Pricing() { | ||
|
||
} | ||
|
||
public Pricing(String owner, String name, String createdTime, String displayName, String application, String description) { | ||
|
||
this.owner = owner; | ||
|
||
this.name = name; | ||
|
||
this.createdTime = createdTime; | ||
|
||
this.displayName = displayName; | ||
|
||
this.description = description; | ||
|
||
this.application = application; | ||
|
||
} | ||
} |
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,52 @@ | ||
// Copyright 2023 The Casdoor Authors. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing CasdoorPermissions and | ||
// limitations under the License. | ||
|
||
package org.casbin.casdoor.entity; | ||
|
||
import java.util.List; | ||
|
||
public class Product { | ||
public String owner; | ||
public String name; | ||
public String createdTime; | ||
public String displayName; | ||
public String image; | ||
public String detail; | ||
public String description; | ||
public String tag; | ||
public String currency; | ||
public double price; | ||
public int quantity; | ||
public int sold; | ||
public List<String> providers; | ||
public String returnUrl; | ||
public String state; | ||
public List<Provier> providerObjs; | ||
|
||
public Product() { | ||
} | ||
|
||
public Product(String owner, String name, String createdTime, String displayName, String image, String description, String tag, int quantity, int sold, String state) { | ||
this.owner = owner; | ||
this.name = name; | ||
this.createdTime = createdTime; | ||
this.displayName = displayName; | ||
this.image = image; | ||
this.description = description; | ||
this.tag = tag; | ||
this.quantity = quantity; | ||
this.sold = sold; | ||
this.state = state; | ||
} | ||
} |
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
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
Oops, something went wrong.