Skip to content

Commit fd17eaa

Browse files
authored
BAEL-20687 Fix test in core-groovy-2 module (#8608)
1 parent d55081b commit fd17eaa

2 files changed

Lines changed: 10 additions & 13 deletions

File tree

core-groovy-2/src/test/groovy/com/baeldung/category/CategoryUnitTest.groovy

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,16 @@ class CategoryUnitTest extends GroovyTestCase {
2828
}
2929
}
3030

31-
// http://team.baeldung.com/browse/BAEL-20687
32-
// void test_whenUsingTimeCategory_thenOperationOnNumber() {
33-
// SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy")
34-
// use (TimeCategory) {
35-
// assert sdf.format(5.days.from.now) == sdf.format(new Date() + 5.days)
36-
//
37-
// sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss")
38-
// assert sdf.format(10.minutes.from.now) == sdf.format(new Date() + 10.minutes)
39-
// assert sdf.format(2.hours.ago) == sdf.format(new Date() - 2.hours)
40-
// }
41-
// }
31+
void test_whenUsingTimeCategory_thenOperationOnNumber() {
32+
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy")
33+
use (TimeCategory) {
34+
assert sdf.format(5.days.from.now) == sdf.format(new Date() + 5.days)
35+
36+
sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss")
37+
assert sdf.format(10.minutes.from.now) == sdf.format(new Date() + 10.minutes)
38+
assert sdf.format(2.hours.ago) == sdf.format(new Date() - 2.hours)
39+
}
40+
}
4241

4342
void test_whenUsingDOMCategory_thenOperationOnXML() {
4443

core-groovy-2/src/test/groovy/com/baeldung/webservice/WebserviceUnitTest.groovy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ class WebserviceManualTest extends GroovyTestCase {
7575
assert stories.size() == 5
7676
}
7777

78-
/* see BAEL-3753
7978
void test_whenConsumingSoap_thenReceiveResponse() {
8079
def url = "http://www.dataaccess.com/webservicesserver/numberconversion.wso"
8180
def soapClient = new SOAPClient(url)
@@ -90,7 +89,6 @@ class WebserviceManualTest extends GroovyTestCase {
9089
def words = response.NumberToWordsResponse
9190
assert words == "one thousand two hundred and thirty four "
9291
}
93-
*/
9492

9593
void test_whenConsumingRestGet_thenReceiveResponse() {
9694
def path = "/get"

0 commit comments

Comments
 (0)