Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw specific exceptions based on the method under testFeature/zfj/add exception on actual #29

Merged
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8d068d4
Throw specific exceptions based on the method under test
zhangfj88 Mar 20, 2024
7cfcfc6
Throw specific exceptions based on the method under test
zhangfj88 Mar 20, 2024
038ba02
Merge pull request #3 from zhangfj88/add-exception-on-actual
zhangfj88 Mar 25, 2024
e17994d
Throw specific exceptions based on the method under test
zhangfj88 Mar 25, 2024
8cba2c5
Throw specific exceptions based on the method under test
zhangfj88 Mar 25, 2024
3cb7ef0
Throw specific exceptions based on the method under test
zhangfj88 Mar 25, 2024
1671e0b
Add a UI setting as "declare specific test method thrown exception ty…
zhangfj88 Mar 26, 2024
86a47ab
Throw specific exceptions based on the method and configuration
zhangfj88 Apr 3, 2024
0579e4f
Throw specific exceptions based on the method and configuration
zhangfj88 Apr 3, 2024
f92797c
Merge branch 'master' into add-exception-on-actual
zhangfj88 Apr 3, 2024
ce60478
Throw specific exceptions based on the method and configuration
zhangfj88 Apr 3, 2024
3385ccf
Throw specific exceptions based on the method and configuration
zhangfj88 Apr 3, 2024
3dc4ae1
Merge pull request #7 from zhangfj88/add-exception-on-actual
zhangfj88 Apr 3, 2024
d1a7e97
Throw specific exceptions based on the method and configuration
zhangfj88 Apr 3, 2024
f0e8d73
Throw specific exceptions based on the method and configuration
zhangfj88 Apr 3, 2024
24f4d08
Merge pull request #8 from zhangfj88/add-exception-on-actual
zhangfj88 Apr 3, 2024
30e421a
Throw specific exceptions based on the method and configuration
zhangfj88 Apr 8, 2024
618b035
Throw specific exceptions based on the method and configuration--add …
zhangfj88 Apr 8, 2024
69343c7
Merge pull request #9 from zhangfj88/add-exception-on-actual
zhangfj88 Apr 9, 2024
43f6a16
Throw specific exceptions based on the method and configuration--add …
zhangfj88 Apr 9, 2024
558874e
Merge pull request #10 from zhangfj88/add-exception-on-actual
zhangfj88 Apr 9, 2024
22c3d16
Throw specific exceptions based on the method and configuration--add …
zhangfj88 Apr 11, 2024
b262555
Merge pull request #11 from zhangfj88/add-exception-on-actual
zhangfj88 Apr 11, 2024
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.weirddev.testme.intellij.generator;


import com.weirddev.testme.intellij.configuration.TestMeConfig;
import com.weirddev.testme.intellij.template.FileTemplateConfig;
import com.weirddev.testme.intellij.template.TemplateRegistry;
import com.weirddev.testme.intellij.template.context.Language;

Expand Down Expand Up @@ -43,5 +45,9 @@ public void testSettersOverCtor() throws Exception{
public void testCtorOverSetters() throws Exception{
doTest(true,true,true,67, false, false);
}

public void testDeclareSpecificTestMethodThrownExceptionTypes() {
final TestMeConfig testMeConfig = new TestMeConfig();
testMeConfig.setThrowSpecificExceptionTypes(false);
doTest(new FileTemplateConfig(testMeConfig));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,9 @@ public void testFileTemplateCustomization() {
doTest(fileTemplateConfig, customization);
}

public void testDeclareSpecificTestMethodThrownExceptionTypes() {
final TestMeConfig testMeConfig = new TestMeConfig();
testMeConfig.setThrowSpecificExceptionTypes(true);
doTest(new FileTemplateConfig(testMeConfig));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.weirddev.testme.intellij.template.context.Language;
import com.weirddev.testme.intellij.ui.customizedialog.FileTemplateCustomization;

import java.util.ArrayList;
import java.util.List;

/**
Expand Down Expand Up @@ -207,6 +206,12 @@ public void testFileTemplateCustomization() {
doTest(fileTemplateConfig, customization);
}

public void testDeclareSpecificTestMethodThrownExceptionTypes() {
final TestMeConfig testMeConfig = new TestMeConfig();
testMeConfig.setThrowSpecificExceptionTypes(true);
doTest(new FileTemplateConfig(testMeConfig));
}

//todo TC - use static init method when constructor not available

// TODO TC different test target dir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.jetbrains.annotations.Nullable;

import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class MethodFactory {
Expand Down Expand Up @@ -56,7 +57,8 @@ public static Method createMethod(PsiMethod psiMethod, PsiClass srcClass, int ma
Optional<PsiSubstitutor> methodSubstitutor = findMethodSubstitutor(psiMethod, srcClass, ownerClassPsiType);
Type returnType = resolveReturnType(psiMethod, maxRecursionDepth, typeDictionary, methodSubstitutor);
List<Param> methodParams = extractMethodParams(psiMethod, isPrimaryConstructor, maxRecursionDepth, typeDictionary, methodSubstitutor);
return new Method(methodId, methodName, returnType, ownerClassCanonicalType, methodParams, isPrivate, isProtected, isDefault, isPublic, isAbstract, isNative,
String throwsExceptions = extractMethodExceptionTypes(psiMethod,typeDictionary.isThrowSpecificExceptionTypes(),testable);
return new Method(methodId, methodName, returnType, ownerClassCanonicalType, methodParams, throwsExceptions,isPrivate, isProtected, isDefault, isPublic, isAbstract, isNative,
isStatic, isSetter, isGetter, isConstructor, overriddenInChild, inherited, isInterface, syntheticMethod, propertyName1, accessible,
isPrimaryConstructor, testable);

Expand Down Expand Up @@ -169,6 +171,25 @@ private static List<Param> extractMethodParams(PsiMethod psiMethod, boolean shou
return params;
}


//analyze the exception types of the method
private static String extractMethodExceptionTypes(PsiMethod psiMethod ,Boolean throwSpecificExceptionTypes,boolean testable) {
if(!testable){
return null;
}
String throwsExceptions = null;
if(throwSpecificExceptionTypes){
PsiReferenceList throwsList = psiMethod.getThrowsList();
PsiClassType[] referencedTypes = throwsList.getReferencedTypes();
throwsExceptions = Arrays.stream(referencedTypes)
.map(PsiClassType::resolve)
.filter(Objects::nonNull)
.map(PsiClass::getQualifiedName)
.filter(Objects::nonNull)
.collect(Collectors.joining(","));
}
return throwsExceptions == null ? "Exception" : throwsExceptions;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in case non found - throwsException would be empty string rather then null, if so please replace with
return throwsException.isEmpty() ? "Exception" : throwsException;
would also be good to change/add integration test to throw a more specific exception (i.e. java.io.IOException) rather then Exception in order to verify mapping logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok,Let me modify the code then submit it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. in case non found - throwsException would be empty string rather then null --YES
  2. in case "Declare specific test method thrown exception types " is not checked --throwsException is null
  3. in cased "Declare specific test method thrown exception types " is checked and The testing method does not contain any exceptions--- then test method does not throw any exceptions.
    I prefer to case 3,
    so ,you prefer to throwing Exception in case 3?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you mean...thanks for elaborating
Ok, lets keep this logic as you suggest. Would like to refine the UI text to better express this into:
"Declare exceptions thrown by tested class" - so it would suggest that only if tested class actually declares exceptions - so will the test method.

Furthermore please do a small refactor... I find that mutating throwsExceptions variable and using it to transitively reflect throwSpecificExceptionTypes state - a bit confusing.

please use this alternative:

    private static String extractMethodExceptionTypes(PsiMethod psiMethod ,Boolean throwSpecificExceptionTypes,boolean testable) {
        if(!testable){
            return null;
        }
        if(throwSpecificExceptionTypes){
            PsiReferenceList throwsList = psiMethod.getThrowsList();
            PsiClassType[] referencedTypes = throwsList.getReferencedTypes();
            String throwsExceptions = Arrays.stream(referencedTypes)
                    .map(PsiClassType::resolve)
                    .filter(Objects::nonNull)
                    .map(PsiClass::getQualifiedName)
                    .filter(Objects::nonNull)
                    .collect(Collectors.joining(","));
            return throwsExceptions.isEmpty() ? null : throwsExceptions;
        }
        else {
            return "Exception";
        }
    }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for optimizing the code. I am modifying the code and then submit.

}
private static ArrayList<Field> findMatchingFields(PsiParameter psiParameter, PsiMethod psiMethod) {
final ArrayList<Field> fields = new ArrayList<>();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ public class TestMeConfig {
*/
private boolean renderInternalMethodCallStubs = false;


/**
* Test generator behavior option. Declare specific test method thrown exception types
* Valid values:true,false
* Default:false
*/
private boolean throwSpecificExceptionTypes = false;
/**
* Test generator behavior option. open user check dialog
* Valid values:true,false
Expand Down Expand Up @@ -92,4 +99,11 @@ public boolean isOpenCustomizeTestDialog() {
public void setOpenCustomizeTestDialog(boolean openCustomizeTestDialog) {
this.openCustomizeTestDialog = openCustomizeTestDialog;
}
public boolean isThrowSpecificExceptionTypes() {
return throwSpecificExceptionTypes;
}

public void setThrowSpecificExceptionTypes(boolean throwSpecificExceptionTypes) {
this.throwSpecificExceptionTypes = throwSpecificExceptionTypes;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Map<String, Object> build(FileTemplateContext context, Properties default
int maxRecursionDepth = context.getFileTemplateConfig().getMaxRecursionDepth();
ctxtParams.put(TestMeTemplateParams.MAX_RECURSION_DEPTH, maxRecursionDepth);
ctxtParams.put(TestMeTemplateParams.StringUtils, new StringUtils());
final TypeDictionary typeDictionary = TypeDictionary.create(context.getSrcClass(), context.getTargetPackage());
final TypeDictionary typeDictionary = TypeDictionary.create(context.getSrcClass(), context.getTargetPackage(),context.getFileTemplateConfig().isThrowSpecificExceptionTypes());
JavaVersion javaVersion = getJavaVersion(context.getTestModule());
ctxtParams.put(TestMeTemplateParams.JAVA_VERSION, javaVersion);
ctxtParams.put(TestMeTemplateParams.TestBuilder, new TestBuilderImpl(context.getLanguage(), context.getSrcModule(), typeDictionary, context.getFileTemplateConfig(), javaVersion));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ public class FileTemplateConfig {
*/
private boolean renderInternalMethodCallStubs = false;


/**
* Test generator behavior option. Declare specific test method thrown exception types
* Valid values:true,false
* Default:false
*/
private boolean throwSpecificExceptionTypes = false;

public FileTemplateConfig(TestMeConfig testMeConfig) {
this(
Integer.valueOf(System.getProperties().getProperty("testMe.generator.maxRecursionDepth", FileTemplateConfig.DEFAULT_MAX_RECURSION_DEPTH + "")),
Expand All @@ -98,6 +106,7 @@ public FileTemplateConfig(TestMeConfig testMeConfig) {
testMeConfig == null || testMeConfig.getOptimizeImports(),
testMeConfig == null || testMeConfig.getGenerateTestsForInheritedMethods(),
testMeConfig == null || testMeConfig.isRenderInternalMethodCallStubs(),
testMeConfig == null || testMeConfig.isThrowSpecificExceptionTypes(),
Boolean.valueOf(System.getProperties().getProperty("testMe.generator.ignoreUnusedProperties", "true")),
Boolean.valueOf(System.getProperties().getProperty("testMe.generator.replaceInterfaceParamsWithConcreteTypes", "true")),
Boolean.valueOf(System.getProperties().getProperty("testMe.generator.stubMockMethodCallsReturnValues", "true")),
Expand All @@ -109,7 +118,7 @@ public FileTemplateConfig(TestMeConfig testMeConfig) {
}

private FileTemplateConfig(int maxRecursionDepth, boolean reformatCode, boolean replaceFqn, boolean optimizeImports,
boolean generateTestsForInheritedMethods, boolean renderInternalMethodCallStubs,
boolean generateTestsForInheritedMethods, boolean renderInternalMethodCallStubs,boolean throwSpecificExceptionTypes,
boolean ignoreUnusedProperties, boolean replaceInterfaceParamsWithConcreteTypes,
boolean stubMockMethodCallsReturnValues, int maxNumOfConcreteCandidatesToReplaceInterfaceParam,
int minPercentOfExcessiveSettersToPreferMapCtor,
Expand All @@ -120,6 +129,7 @@ private FileTemplateConfig(int maxRecursionDepth, boolean reformatCode, boolean
this.optimizeImports = optimizeImports;
this.generateTestsForInheritedMethods = generateTestsForInheritedMethods;
this.renderInternalMethodCallStubs = renderInternalMethodCallStubs;
this.throwSpecificExceptionTypes = throwSpecificExceptionTypes;
this.stubMockMethodCallsReturnValues = stubMockMethodCallsReturnValues;
this.ignoreUnusedProperties = ignoreUnusedProperties;
this.replaceInterfaceParamsWithConcreteTypes = replaceInterfaceParamsWithConcreteTypes;
Expand Down Expand Up @@ -208,4 +218,8 @@ public boolean isRenderInternalMethodCallStubs() {
public void setRenderInternalMethodCallStubs(boolean renderInternalMethodCallStubs) {
this.renderInternalMethodCallStubs = renderInternalMethodCallStubs;
}

public boolean isThrowSpecificExceptionTypes() {
return throwSpecificExceptionTypes;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@ public class TypeDictionary {
private final List<String> testSubjectMethodParamsType;
private AtomicInteger newTypeCounter = new AtomicInteger();
private AtomicInteger existingTypeHitsCounter = new AtomicInteger();
private boolean throwSpecificExceptionTypes;

private TypeDictionary(PsiClass srcClass, PsiPackage targetPackage, Set<ResolvedMethodCall> methodCallsFromTestSubject, List<String> testSubjectMethodParamsType) {
private TypeDictionary(PsiClass srcClass, PsiPackage targetPackage, Set<ResolvedMethodCall> methodCallsFromTestSubject, List<String> testSubjectMethodParamsType,boolean throwSpecificExceptionTypes) {
this.testSubjectClass = srcClass;
this.testSubjectTypesNames = resolveTypesNames(srcClass);
this.targetPackage = targetPackage;
this.methodCallsFromTestSubject = methodCallsFromTestSubject;
this.testSubjectMethodParamsType = testSubjectMethodParamsType;
this.relevantMethodIdsCache = new LruCache<>(MAX_RELEVANT_METHOD_IDS_CACHE);
startTimestamp = System.currentTimeMillis();
this.throwSpecificExceptionTypes = throwSpecificExceptionTypes;
}

private Set<String> resolveTypesNames(PsiClass srcClass) {
Expand All @@ -54,7 +56,7 @@ private Set<String> resolveTypesNames(PsiClass srcClass) {
return typesNames;
}

public static TypeDictionary create(PsiClass srcClass, PsiPackage targetPackage){
public static TypeDictionary create(PsiClass srcClass, PsiPackage targetPackage,boolean throwSpecificExceptionTypes){
Set<ResolvedMethodCall> methodCallsFromTestSubject = new HashSet<>();
if (srcClass != null) {
for (PsiMethod method : srcClass.getAllMethods()) {
Expand All @@ -64,7 +66,7 @@ public static TypeDictionary create(PsiClass srcClass, PsiPackage targetPackage)
}
}
List<String> testSubjectMethodParamsType = srcClass == null ? List.of() : Arrays.stream(srcClass.getAllMethods()).flatMap(psiMethod1 -> Arrays.stream(psiMethod1.getParameterList().getParameters()).map(p -> p.getType().getCanonicalText()).filter(TypeUtils::isBasicType)).toList();
return new TypeDictionary(srcClass, targetPackage, methodCallsFromTestSubject, testSubjectMethodParamsType);
return new TypeDictionary(srcClass, targetPackage, methodCallsFromTestSubject, testSubjectMethodParamsType,throwSpecificExceptionTypes);
}

/**
Expand Down Expand Up @@ -165,4 +167,12 @@ public void logStatistics() {
LOG.info("**** Statistics: took %dms. type hits/req:%d/%d method relevancy cache %s".formatted(
startTimestamp - System.currentTimeMillis(),newTypeCounter.get(), newTypeCounter.get() + existingTypeHitsCounter.get(), relevantMethodIdsCache.getUsageStats()));
}

public boolean isThrowSpecificExceptionTypes() {
return throwSpecificExceptionTypes;
}

public void setThrowSpecificExceptionTypes(boolean throwSpecificExceptionTypes) {
this.throwSpecificExceptionTypes = throwSpecificExceptionTypes;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public class Method {
* method arguments
*/
private final List<Param> methodParams;

/**
* method exception types
*/
private final String methodExceptionTypes;
/**
* true - if method has private modifier
*/
Expand Down Expand Up @@ -151,5 +156,5 @@ public boolean hasReturn(){
public boolean hasParams() {
return !methodParams.isEmpty();
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<grid id="a18c4" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="a18c4" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="true">
Expand Down Expand Up @@ -50,6 +50,14 @@
<text value="Open customization dialog before test generation"/>
</properties>
</component>
<component id="7cd0d" class="javax.swing.JCheckBox" binding="throwSpecificExceptionTypesCheckBox">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Declare specific test method thrown exception types"/>
</properties>
</component>
</children>
</grid>
<grid id="4c6fe" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class TestMeSettingsForm implements Disposable {
private JPanel rootPanel;
private JCheckBox renderInternalMethodCallStubsBox;
private JCheckBox openUserCheckDialogBox;
private JCheckBox throwSpecificExceptionTypesCheckBox;

public JPanel getRootPanel() {
return rootPanel;
Expand All @@ -37,6 +38,7 @@ public void persistState(TestMeConfig testMeConfig) {
testMeConfig.setReplaceFullyQualifiedNames(replaceFullyQualifiedNamesCheckBox.isSelected());
testMeConfig.setRenderInternalMethodCallStubs(renderInternalMethodCallStubsBox.isSelected());
testMeConfig.setOpenCustomizeTestDialog(openUserCheckDialogBox.isSelected());
testMeConfig.setThrowSpecificExceptionTypes(throwSpecificExceptionTypesCheckBox.isSelected());
}
}

Expand All @@ -48,6 +50,7 @@ public void reset(TestMeConfig state) {
replaceFullyQualifiedNamesCheckBox.setSelected(state.getReplaceFullyQualifiedNames());
renderInternalMethodCallStubsBox.setSelected(state.isRenderInternalMethodCallStubs());
openUserCheckDialogBox.setSelected(state.isOpenCustomizeTestDialog());
throwSpecificExceptionTypesCheckBox.setSelected(state.isThrowSpecificExceptionTypes());
}
}

Expand All @@ -58,7 +61,8 @@ public boolean isDirty(TestMeConfig state) {
reformatCodeCheckBox.isSelected() != state.getReformatCode() ||
replaceFullyQualifiedNamesCheckBox.isSelected() != state.getReplaceFullyQualifiedNames() ||
renderInternalMethodCallStubsBox.isSelected() != state.isRenderInternalMethodCallStubs() ||
openUserCheckDialogBox.isSelected() != state.isOpenCustomizeTestDialog()
openUserCheckDialogBox.isSelected() != state.isOpenCustomizeTestDialog()||
throwSpecificExceptionTypesCheckBox.isSelected() != state.isThrowSpecificExceptionTypes()
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class ${CLASS_NAME} {
#if($TestSubjectUtils.shouldBeTested($method))

@Test
public void #renderTestMethodName($method.name)() throws Exception {
public void #renderTestMethodName($method.name)()#if($method.methodExceptionTypes) throws $method.methodExceptionTypes#end {
#if($hasMocks && $MockitoMockBuilder.shouldStub($method,$TESTED_CLASS))
#renderMockStubs($method,$TESTED_CLASS)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class ${CLASS_NAME} {
#foreach($method in $TESTED_CLASS.methods)
#if($TestSubjectUtils.shouldBeTested($method))
@Test
public void #renderTestMethodName($method.name)() throws Exception {
public void #renderTestMethodName($method.name)()#if($method.methodExceptionTypes) throws $method.methodExceptionTypes#end {
#if($hasMocks && $PowerMockBuilder.shouldStub($method, $TESTED_CLASS))
#renderMockStubs($method, $TESTED_CLASS)
#end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.example.services.impl;

import com.example.foes.Fire;

public class Foo
{
public Fire hasException(Fire tee) throws Exception {
return tee;
}
public Fire hasNoException(Fire tee) {
return tee;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.example.services.impl;

import com.example.foes.Fire;
import org.junit.Assert;
import org.junit.Test;

/**
* created by TestMe integration test on MMXVI
*/
public class FooTest {
Foo foo = new Foo();

@Test
public void testHasException() throws Exception {
Fire result = foo.hasException(new Fire());
Assert.assertEquals(new Fire(), result);
}

@Test
public void testHasNoException() {
Fire result = foo.hasNoException(new Fire());
Assert.assertEquals(new Fire(), result);
}
}

//Generated with love by TestMe :) Please raise issues & feature requests at: https://weirddev.com/forum#!/testme
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.example.services.impl

import com.example.foes.Fire
import org.junit.Test

/** created by TestMe integration test on MMXVI */
class FooTest {
Foo foo = new Foo()

@Test
void testHasException() {
Fire result = foo.hasException(new Fire())
assert result == new Fire()
}

@Test
void testHasNoException() {
Fire result = foo.hasNoException(new Fire())
assert result == new Fire()
}
}

//Generated with love by TestMe :) Please raise issues & feature requests at: https://weirddev.com/forum#!/testme
Loading
Loading