Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eclipse Projects
Eclipse openK User Modules
org.eclipse.openk-usermodules.gridFailureInformation.backend
Commits
91ff9d3a
Commit
91ff9d3a
authored
Nov 24, 2020
by
Simon Reis
Browse files
Tests adjusted
parent
f0d2e767
Changes
4
Hide whitespace changes
Inline
Side-by-side
mailExport/sonar-project.properties
View file @
91ff9d3a
...
...
@@ -26,7 +26,7 @@ sonar.sources=src/main
sonar.exclusions
=
**/model/*.java,**/viewmodel/*.java, **/emails/emailTemplate.html
sonar.tests
=
src/test
#sonar.test.inclusions=**/*.spec.ts
sonar.test.exclusions
=
**/model/**,**/viewmodel/**
sonar.test.exclusions
=
**/model/**,**/viewmodel/**
, **/emails/emailTemplate.html
#sonar.ts.tslintconfigpath=tslint.json
sonar.typescript.lcov.reportPaths
=
coverage/lcov.info
\ No newline at end of file
mailExport/src/test/java/org/eclipse/openk/gridfailureinformation/mailexport/service/EmailServiceTest.java
View file @
91ff9d3a
...
...
@@ -93,12 +93,14 @@ public class EmailServiceTest {
@Test
public
void
testSendMail_nok
()
{
mailServer
.
stop
();
emailConfig
.
setUseHtmlEmailTemplate
(
false
);
MailMessageDto
mailMessageDto
=
MockDataHelper
.
mockMailMessageDto
();
assertThrows
(
MessagingException
.
class
,
()
->
emailService
.
sendMail
(
mailMessageDto
));
}
@Test
public
void
testSendMail_invalidRecipient
()
{
emailConfig
.
setHtmlEmail
(
false
);
MailMessageDto
mailMessageDto
=
MockDataHelper
.
mockMailMessageDtoWrongRecipientFormat
();
assertThrows
(
MessagingException
.
class
,
()
->
emailService
.
sendMail
(
mailMessageDto
));
}
...
...
@@ -109,6 +111,8 @@ public class EmailServiceTest {
emailConfig
.
setSmtpHost
(
"localhost"
);
emailConfig
.
setEmailPort
(
"3025"
);
emailConfig
.
setSender
(
"testCaseSendertest.de"
);
emailConfig
.
setHtmlEmail
(
false
);
emailConfig
.
setUseHtmlEmailTemplate
(
false
);
assertThrows
(
MessagingException
.
class
,
()
->
{
GfiEmail
emailManager
=
new
GfiEmail
(
emailConfig
);
emailManager
.
sendEmail
();
...
...
mailExport/src/test/java/org/eclipse/openk/gridfailureinformation/mailexport/util/ResourceLoaderBaseTest.java
0 → 100644
View file @
91ff9d3a
/*
*******************************************************************************
* Copyright (c) 2018 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************
*/
package
org.eclipse.openk.gridfailureinformation.mailexport.util
;
import
org.junit.jupiter.api.Test
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertNull
;
public
class
ResourceLoaderBaseTest
{
@Test
public
void
testLoadStringFromResourceNotFound
()
{
ResourceLoaderBase
rlb
=
new
ResourceLoaderBase
();
String
retString
=
rlb
.
loadStringFromResource
(
"testNotExisting.txt"
);
assertNull
(
retString
);
}
@Test
public
void
testLoadStringFromResource
()
{
ResourceLoaderBase
rlb
=
new
ResourceLoaderBase
();
String
retString
=
rlb
.
loadStringFromResource
(
"testCase.txt"
);
assertNotNull
(
retString
);
}
}
mailExport/src/test/resources/testCase.txt
0 → 100644
View file @
91ff9d3a
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment