mirror of
https://github.com/valitydev/fraudo.git
synced 2024-11-06 01:45:16 +00:00
Fix trusted (#40)
This commit is contained in:
parent
a9ee711d74
commit
e541e47ebc
2
pom.xml
2
pom.xml
@ -11,7 +11,7 @@
|
||||
</parent>
|
||||
|
||||
<artifactId>fraudo</artifactId>
|
||||
<version>0.0.21</version>
|
||||
<version>0.0.22</version>
|
||||
|
||||
<name>Fraudo</name>
|
||||
<description>Language for describing antifraud patterns</description>
|
||||
|
@ -38,6 +38,7 @@ relationalExpression
|
||||
| like
|
||||
| is_mobile
|
||||
| is_recurrent
|
||||
| is_trusted
|
||||
;
|
||||
|
||||
unaryExpression
|
||||
@ -110,5 +111,5 @@ is_recurrent
|
||||
;
|
||||
|
||||
is_trusted
|
||||
: 'is_trusted' LPAREN RPAREN
|
||||
: 'isTrusted' LPAREN RPAREN
|
||||
;
|
||||
|
@ -134,6 +134,17 @@ public class CustomTest extends AbstractPaymentTest {
|
||||
assertEquals(ResultStatus.ACCEPT, ResultUtils.findFirstNotNotifyStatus(result).get().getResultStatus());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void trustedTest() throws Exception {
|
||||
InputStream resourceAsStream = CustomTest.class.getResourceAsStream("/rules/is_trusted.frd");
|
||||
when(customerTypeResolver.isTrusted(any())).thenReturn(true);
|
||||
|
||||
ParseContext parseContext = getParseContext(resourceAsStream);
|
||||
PaymentModel model = new PaymentModel();
|
||||
ResultModel result = invoke(parseContext, model);
|
||||
assertEquals(ResultStatus.ACCEPT, ResultUtils.findFirstNotNotifyStatus(result).get().getResultStatus());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void payerTypeTest() throws Exception {
|
||||
InputStream resourceAsStream = CustomTest.class.getResourceAsStream("/rules/is_recurrent.frd");
|
||||
|
1
src/test/resources/rules/is_trusted.frd
Normal file
1
src/test/resources/rules/is_trusted.frd
Normal file
@ -0,0 +1 @@
|
||||
rule: isTrusted() -> accept;
|
Loading…
Reference in New Issue
Block a user