Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ Argument.ofType(CustomType.class);
Use the `Argument.Matchable` interface and then use it with `Argument` APIs

```java
@isTest
@IsTest
public class MyMatchable implements Argument.Matchable {
public Boolean matches(Object callArgument) {
boolean matches = false;
Expand Down
4 changes: 2 additions & 2 deletions apex-ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<description>Custom Ruleset to use with Apex PMD</description>

<!-- Best Practices -->
<rule ref="category/apex/bestpractices.xml/ApexUnitTestMethodShouldHaveIsTestAnnotation" message="Apex test methods should have @isTest annotation">
<rule ref="category/apex/bestpractices.xml/ApexUnitTestMethodShouldHaveIsTestAnnotation" message="Apex test methods should have @IsTest annotation">
<priority>2</priority>
</rule>
<rule
ref="category/apex/bestpractices.xml/ApexUnitTestShouldNotUseSeeAllDataTrue"
message="@isTest(seeAllData=true) should not be used in Apex unit tests because it opens up the existing database data for unexpected modification by tests"
message="@IsTest(seeAllData=true) should not be used in Apex unit tests because it opens up the existing database data for unexpected modification by tests"
>
<priority>3</priority>
</rule>
Expand Down
4 changes: 2 additions & 2 deletions force-app/recipes/classes/ApexMockeryOverview.cls
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class ApexMockeryOverview {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
2 changes: 1 addition & 1 deletion force-app/recipes/classes/OperaPastryMatchable.cls
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
public class OperaPastryMatchable implements Argument.Matchable {
public Boolean matches(Object callArgument) {
Pastry p = (Pastry) callArgument;
Expand Down
4 changes: 2 additions & 2 deletions force-app/recipes/classes/asserting/HasBeenCalled.cls
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class HasBeenCalled {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
4 changes: 2 additions & 2 deletions force-app/recipes/classes/asserting/HasBeenCalledTimes.cls
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class HasBeenCalledTimes {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
4 changes: 2 additions & 2 deletions force-app/recipes/classes/asserting/HasBeenCalledWith.cls
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class HasBeenCalledWith {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class HasBeenCalledWithCustomMatchable {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class HasBeenCalledWithJSONMatchable {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class HasBeenCalledWithTypeMatchable {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class HasBeenLastCalledWith {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
4 changes: 2 additions & 2 deletions force-app/recipes/classes/asserting/HasNotBeenCalled.cls
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class HasNotBeenCalled {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
4 changes: 2 additions & 2 deletions force-app/recipes/classes/mocking/Behave.cls
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class Behave {
class MockImpl implements MethodSpy.SpyBehavior {
public Object execute(final List<Object> params) {
return Date.today().addDays(10);
}
}

@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
4 changes: 2 additions & 2 deletions force-app/recipes/classes/mocking/BehaveOnce.cls
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class BehaveOnce {
class MockImpl implements MethodSpy.SpyBehavior {
public Object execute(final List<Object> params) {
return Date.today().addDays(10);
}
}

@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
4 changes: 2 additions & 2 deletions force-app/recipes/classes/mocking/NoConfiguration.cls
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class NoConfiguration {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
4 changes: 2 additions & 2 deletions force-app/recipes/classes/mocking/Returns.cls
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class Returns {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
4 changes: 2 additions & 2 deletions force-app/recipes/classes/mocking/ReturnsOnce.cls
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class ReturnsOnce {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
4 changes: 2 additions & 2 deletions force-app/recipes/classes/mocking/ReturnsThenThrows.cls
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class ReturnsThenThrows {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
4 changes: 2 additions & 2 deletions force-app/recipes/classes/mocking/Throws.cls
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class Throws {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
4 changes: 2 additions & 2 deletions force-app/recipes/classes/mocking/ThrowsOnce.cls
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class ThrowsOnce {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
4 changes: 2 additions & 2 deletions force-app/recipes/classes/mocking/ThrowsThenReturns.cls
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class ThrowsThenReturns {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class WhenCalledWithCustomMatchable_ThenReturn {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class WhenCalledWithEqualMatching_ThenReturn {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class WhenCalledWithJSONMatching_ThenReturn {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class WhenCalledWithMatchingThrowsAndReturns {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class WhenCalledWithNotMatchingAndReturn {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class WhenCalledWithTypeMatching_ThenReturn {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class WhenCalledWith_ThenBehave {
class MockImpl implements MethodSpy.SpyBehavior {
public Object execute(final List<Object> params) {
return Date.today().addDays(10);
}
}

@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class WhenCalledWith_ThenReturnOnce {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class WhenCalledWith_ThenThrow {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class WhenCalledWith_ThenThrowOnce {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
@isTest
@IsTest
private class WhenCalledWithoutMatchingConfiguration {
@isTest
@IsTest
static void recipe() {
// Arrange
Mock deliveryServiceMock = Mock.forType(DeliveryService.class);
Expand Down
Loading
Loading