You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by vo...@apache.org on 2020/05/08 15:04:51 UTC
[fineract] branch develop updated: clean up XBRLBuilderTest (re.
FINERACT-940)
This is an automated email from the ASF dual-hosted git repository.
vorburger pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git
The following commit(s) were added to refs/heads/develop by this push:
new ea85f9c clean up XBRLBuilderTest (re. FINERACT-940)
ea85f9c is described below
commit ea85f9c739f5b005321d5282d71c2e1dd7721b33
Author: Michael Vorburger <mi...@vorburger.ch>
AuthorDate: Fri May 8 13:57:30 2020 +0200
clean up XBRLBuilderTest (re. FINERACT-940)
---
.../mix/report/service/XBRLBuilderTest.java | 22 ++++------------------
1 file changed, 4 insertions(+), 18 deletions(-)
diff --git a/fineract-provider/src/test/java/org/apache/fineract/mix/report/service/XBRLBuilderTest.java b/fineract-provider/src/test/java/org/apache/fineract/mix/report/service/XBRLBuilderTest.java
index 98d4fab..1fe2011 100644
--- a/fineract-provider/src/test/java/org/apache/fineract/mix/report/service/XBRLBuilderTest.java
+++ b/fineract-provider/src/test/java/org/apache/fineract/mix/report/service/XBRLBuilderTest.java
@@ -51,43 +51,29 @@ public class XBRLBuilderTest {
@Mock
private NamespaceReadPlatformServiceImpl readNamespaceService;
+
@InjectMocks
private final XBRLBuilder xbrlBuilder = new XBRLBuilder();
@Before
public void setUp() {
-
this.readNamespaceService = Mockito.mock(NamespaceReadPlatformServiceImpl.class);
lenient().when(this.readNamespaceService.retrieveNamespaceByPrefix(ArgumentMatchers.anyString())).thenReturn(
new NamespaceData(1l, "mockedprefix", "mockedurl"));
-
}
- @SuppressWarnings("null")
@Test
- public void shouldCorrectlyBuildMap() {
-
+ public void shouldCorrectlyBuildMap() throws SAXException, IOException, ParserConfigurationException {
final HashMap<MixTaxonomyData, BigDecimal> map = new HashMap<MixTaxonomyData, BigDecimal>();
final MixTaxonomyData data1 = Mockito.mock(MixTaxonomyData.class);
when(data1.getName()).thenReturn("Assets");
map.put(data1, new BigDecimal(10000));
final String result = this.xbrlBuilder.build(map, Date.valueOf("2005-11-11"), Date.valueOf("2013-07-17"), "USD");
System.out.println(result);
- NodeList nodes = null;
- try {
- nodes =
- DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new ByteArrayInputStream(result.getBytes(StandardCharsets.UTF_8)))
- .getElementsByTagName("Assets");
- } catch (final SAXException e) {
- e.printStackTrace();
- } catch (final IOException e) {
- e.printStackTrace();
- } catch (final ParserConfigurationException e) {
- e.printStackTrace();
- }
+ NodeList nodes = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(
+ new ByteArrayInputStream(result.getBytes(StandardCharsets.UTF_8))).getElementsByTagName("Assets");
assertNotNull(nodes);
assertNotNull(nodes.item(0));
assertEquals("Assets", nodes.item(0).getNodeName());
}
-
}