target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testRefresh() { final DocumentationLinks value = mock(DocumentationLinks.class); final DMNExternalLink externalLink = mock(DMNExternalLink.class); final List<DMNExternalLink> links = new ArrayList<>(); links.add(externalLink); final DocumentationLinkItem listItem = mock(DocumentationLinkItem.class); f...
void refresh() { final List<DMNExternalLink> all = getValue().getLinks(); RemoveHelper.removeChildren(linksContainer); for (final DMNExternalLink link : all) { final DocumentationLinkItem listItem = listItems.get(); listItem.init(link); listItem.setOnDeleted(this::onExternalLinkDeleted); linksContainer.appendChild(list...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void refresh() { final List<DMNExternalLink> all = getValue().getLinks(); RemoveHelper.removeChildren(linksContainer); for (final DMNExternalLink link : all...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void refresh() { final List<DMNExternalLink> all = getValue().getLinks(); RemoveHelper.removeChildren(linksContainer); for (final DMNExternalLink link : all...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void refresh() { final List<DMNExternalLink> all = getValue().getLinks(); RemoveHelper.removeChildren(linksContainer); for (final DMNExternalLink link : all...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void refresh() { final List<DMNExternalLink> all = getValue().getLinks(); RemoveHelper.removeChildren(linksContainer); for (final DMNExternalLink link : all...
@Test public void testRefreshContainersVisibility() { final DocumentationLinks value = mock(DocumentationLinks.class); final DMNExternalLink externalLink = mock(DMNExternalLink.class); final List<DMNExternalLink> links = new ArrayList<>(); links.add(externalLink); when(value.getLinks()).thenReturn(links); widget.setVal...
void refreshContainersVisibility() { if (getValue().getLinks().size() == 0) { HiddenHelper.show(noneContainer); HiddenHelper.hide(linksContainer); } else { HiddenHelper.hide(noneContainer); HiddenHelper.show(linksContainer); } }
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void refreshContainersVisibility() { if (getValue().getLinks().size() == 0) { HiddenHelper.show(noneContainer); HiddenHelper.hide(linksContainer); } else { ...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void refreshContainersVisibility() { if (getValue().getLinks().size() == 0) { HiddenHelper.show(noneContainer); HiddenHelper.hide(linksContainer); } else { ...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void refreshContainersVisibility() { if (getValue().getLinks().size() == 0) { HiddenHelper.show(noneContainer); HiddenHelper.hide(linksContainer); } else { ...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void refreshContainersVisibility() { if (getValue().getLinks().size() == 0) { HiddenHelper.show(noneContainer); HiddenHelper.hide(linksContainer); } else { ...
@Test public void testParseFunctionInvocation() { final RangeValue rangeValue = service.parseRangeValue("[ date ( \"2018-01-01\" ) .. date( \"2018-02-02\" ) ]"); assertEquals("date(\"2018-01-01\")", rangeValue.getStartValue()); assertEquals("date(\"2018-02-02\")", rangeValue.getEndValue()); }
@Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { final RangeNode rangeNode = (RangeNode) baseNode; ...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
@Test public void testOnExternalLinkDeleted() { final DocumentationLinks value = mock(DocumentationLinks.class); final DMNExternalLink externalLink = mock(DMNExternalLink.class); final List<DMNExternalLink> links = new ArrayList<>(); links.add(externalLink); when(value.getLinks()).thenReturn(links); widget.setValue(val...
void onExternalLinkDeleted(final DMNExternalLink externalLink) { locker.fire(new LockRequiredEvent()); getValue().getLinks().remove(externalLink); refresh(); }
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void onExternalLinkDeleted(final DMNExternalLink externalLink) { locker.fire(new LockRequiredEvent()); getValue().getLinks().remove(externalLink); refresh()...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void onExternalLinkDeleted(final DMNExternalLink externalLink) { locker.fire(new LockRequiredEvent()); getValue().getLinks().remove(externalLink); refresh()...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void onExternalLinkDeleted(final DMNExternalLink externalLink) { locker.fire(new LockRequiredEvent()); getValue().getLinks().remove(externalLink); refresh()...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void onExternalLinkDeleted(final DMNExternalLink externalLink) { locker.fire(new LockRequiredEvent()); getValue().getLinks().remove(externalLink); refresh()...
@Test public void testOnDMNExternalLinkCreated() { final DMNExternalLink createdLink = mock(DMNExternalLink.class); final DocumentationLinks value = mock(DocumentationLinks.class); widget.setValue(value); widget.onDMNExternalLinkCreated(createdLink); verify(value).addLink(createdLink); verify(locker).fire(any()); verif...
void onDMNExternalLinkCreated(final DMNExternalLink externalLink) { locker.fire(new LockRequiredEvent()); getValue().addLink(externalLink); refresh(); }
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void onDMNExternalLinkCreated(final DMNExternalLink externalLink) { locker.fire(new LockRequiredEvent()); getValue().addLink(externalLink); refresh(); } }
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void onDMNExternalLinkCreated(final DMNExternalLink externalLink) { locker.fire(new LockRequiredEvent()); getValue().addLink(externalLink); refresh(); } @In...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void onDMNExternalLinkCreated(final DMNExternalLink externalLink) { locker.fire(new LockRequiredEvent()); getValue().addLink(externalLink); refresh(); } @In...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void onDMNExternalLinkCreated(final DMNExternalLink externalLink) { locker.fire(new LockRequiredEvent()); getValue().addLink(externalLink); refresh(); } @In...
@Test public void testInit() { final String addText = "add"; final String noLinkText = "no link text"; when(translationService.getTranslation(DMNDocumentationI18n_Add)).thenReturn(addText); when(translationService.getTranslation(DMNDocumentationI18n_None)).thenReturn(noLinkText); widget.init(); assertEquals(addLink.tex...
@PostConstruct public void init() { nameAndUrlPopover.setOnExternalLinkCreated(this::onDMNExternalLinkCreated); addLink.textContent = translationService.getTranslation(DMNDocumentationI18n_Add); noLink.textContent = translationService.getTranslation(DMNDocumentationI18n_None); setupAddButtonReadOnlyStatus(); }
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { @PostConstruct public void init() { nameAndUrlPopover.setOnExternalLinkCreated(this::onDMNExternalLinkCreated); addLink.textContent = translationService.get...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { @PostConstruct public void init() { nameAndUrlPopover.setOnExternalLinkCreated(this::onDMNExternalLinkCreated); addLink.textContent = translationService.get...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { @PostConstruct public void init() { nameAndUrlPopover.setOnExternalLinkCreated(this::onDMNExternalLinkCreated); addLink.textContent = translationService.get...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { @PostConstruct public void init() { nameAndUrlPopover.setOnExternalLinkCreated(this::onDMNExternalLinkCreated); addLink.textContent = translationService.get...
@Test public void testSetupAddButtonReadOnlyStatusWhenIsReadOnly() { when(readOnlyProvider.isReadOnlyDiagram()).thenReturn(true); widget.setupAddButtonReadOnlyStatus(); verify(addButtonClassList).add(READ_ONLY_CSS_CLASS); verify(addButtonClassList, never()).remove(READ_ONLY_CSS_CLASS); }
void setupAddButtonReadOnlyStatus() { if (readOnlyProvider.isReadOnlyDiagram()) { addButton.classList.add(READ_ONLY_CSS_CLASS); } else { addButton.classList.remove(READ_ONLY_CSS_CLASS); } }
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void setupAddButtonReadOnlyStatus() { if (readOnlyProvider.isReadOnlyDiagram()) { addButton.classList.add(READ_ONLY_CSS_CLASS); } else { addButton.classList...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void setupAddButtonReadOnlyStatus() { if (readOnlyProvider.isReadOnlyDiagram()) { addButton.classList.add(READ_ONLY_CSS_CLASS); } else { addButton.classList...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void setupAddButtonReadOnlyStatus() { if (readOnlyProvider.isReadOnlyDiagram()) { addButton.classList.add(READ_ONLY_CSS_CLASS); } else { addButton.classList...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void setupAddButtonReadOnlyStatus() { if (readOnlyProvider.isReadOnlyDiagram()) { addButton.classList.add(READ_ONLY_CSS_CLASS); } else { addButton.classList...
@Test public void testSetupAddButtonReadOnlyStatusWhenIsNotReadOnly() { when(readOnlyProvider.isReadOnlyDiagram()).thenReturn(false); widget.setupAddButtonReadOnlyStatus(); verify(addButtonClassList, never()).add(READ_ONLY_CSS_CLASS); verify(addButtonClassList).remove(READ_ONLY_CSS_CLASS); }
void setupAddButtonReadOnlyStatus() { if (readOnlyProvider.isReadOnlyDiagram()) { addButton.classList.add(READ_ONLY_CSS_CLASS); } else { addButton.classList.remove(READ_ONLY_CSS_CLASS); } }
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void setupAddButtonReadOnlyStatus() { if (readOnlyProvider.isReadOnlyDiagram()) { addButton.classList.add(READ_ONLY_CSS_CLASS); } else { addButton.classList...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void setupAddButtonReadOnlyStatus() { if (readOnlyProvider.isReadOnlyDiagram()) { addButton.classList.add(READ_ONLY_CSS_CLASS); } else { addButton.classList...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void setupAddButtonReadOnlyStatus() { if (readOnlyProvider.isReadOnlyDiagram()) { addButton.classList.add(READ_ONLY_CSS_CLASS); } else { addButton.classList...
DocumentationLinksWidget extends Composite implements HasValue<DocumentationLinks>, HasEnabled { void setupAddButtonReadOnlyStatus() { if (readOnlyProvider.isReadOnlyDiagram()) { addButton.classList.add(READ_ONLY_CSS_CLASS); } else { addButton.classList...
@Test public void testInit() { final String url = "http: final String description = "My nice description."; final DMNExternalLink externalLink = new DMNExternalLink(); externalLink.setDescription(description); externalLink.setUrl(url); documentationLinkItem.init(externalLink); assertEquals(description, link.textContent...
@Override public void init(final DMNExternalLink externalLink) { this.externalLink = externalLink; link.href = externalLink.getUrl(); link.textContent = externalLink.getDescription(); }
DocumentationLinkItem implements UberElemental<DMNExternalLink> { @Override public void init(final DMNExternalLink externalLink) { this.externalLink = externalLink; link.href = externalLink.getUrl(); link.textContent = externalLink.getDescription(); } }
DocumentationLinkItem implements UberElemental<DMNExternalLink> { @Override public void init(final DMNExternalLink externalLink) { this.externalLink = externalLink; link.href = externalLink.getUrl(); link.textContent = externalLink.getDescription(); } @Inject DocumentationLinkItem(final HTMLDivElement item, ...
DocumentationLinkItem implements UberElemental<DMNExternalLink> { @Override public void init(final DMNExternalLink externalLink) { this.externalLink = externalLink; link.href = externalLink.getUrl(); link.textContent = externalLink.getDescription(); } @Inject DocumentationLinkItem(final HTMLDivElement item, ...
DocumentationLinkItem implements UberElemental<DMNExternalLink> { @Override public void init(final DMNExternalLink externalLink) { this.externalLink = externalLink; link.href = externalLink.getUrl(); link.textContent = externalLink.getDescription(); } @Inject DocumentationLinkItem(final HTMLDivElement item, ...
@Test public void testOnDeleteLinkClick() { final Consumer<DMNExternalLink> onDelete = mock(Consumer.class); documentationLinkItem.setOnDeleted(onDelete); final DMNExternalLink externalLink = mock(DMNExternalLink.class); documentationLinkItem.init(externalLink); documentationLinkItem.onDeleteLinkClick(null); verify(onD...
@SuppressWarnings("unused") @EventHandler("deleteLink") public void onDeleteLinkClick(final ClickEvent clickEvent) { if (!Objects.isNull(getOnDeleted())) { getOnDeleted().accept(externalLink); } }
DocumentationLinkItem implements UberElemental<DMNExternalLink> { @SuppressWarnings("unused") @EventHandler("deleteLink") public void onDeleteLinkClick(final ClickEvent clickEvent) { if (!Objects.isNull(getOnDeleted())) { getOnDeleted().accept(externalLink); } } }
DocumentationLinkItem implements UberElemental<DMNExternalLink> { @SuppressWarnings("unused") @EventHandler("deleteLink") public void onDeleteLinkClick(final ClickEvent clickEvent) { if (!Objects.isNull(getOnDeleted())) { getOnDeleted().accept(externalLink); } } @Inject DocumentationLinkItem(final HTMLDivElement item,...
DocumentationLinkItem implements UberElemental<DMNExternalLink> { @SuppressWarnings("unused") @EventHandler("deleteLink") public void onDeleteLinkClick(final ClickEvent clickEvent) { if (!Objects.isNull(getOnDeleted())) { getOnDeleted().accept(externalLink); } } @Inject DocumentationLinkItem(final HTMLDivElement item,...
DocumentationLinkItem implements UberElemental<DMNExternalLink> { @SuppressWarnings("unused") @EventHandler("deleteLink") public void onDeleteLinkClick(final ClickEvent clickEvent) { if (!Objects.isNull(getOnDeleted())) { getOnDeleted().accept(externalLink); } } @Inject DocumentationLinkItem(final HTMLDivElement item,...
@Test public void testCreate() { final String url = "url"; final String description = "description"; final DMNDocumentationExternalLink created = DMNDocumentationExternalLink.create(description, url); assertEquals(url, created.getUrl()); assertEquals(description, created.getDescription()); }
@JsOverlay public static DMNDocumentationExternalLink create(final String description, final String url) { final DMNDocumentationExternalLink link = new DMNDocumentationExternalLink(); link.description = description; link.url = url; return link; }
DMNDocumentationExternalLink { @JsOverlay public static DMNDocumentationExternalLink create(final String description, final String url) { final DMNDocumentationExternalLink link = new DMNDocumentationExternalLink(); link.description = description; link.url = url; return link; } }
DMNDocumentationExternalLink { @JsOverlay public static DMNDocumentationExternalLink create(final String description, final String url) { final DMNDocumentationExternalLink link = new DMNDocumentationExternalLink(); link.description = description; link.url = url; return link; } private DMNDocumentationExternalLink(); ...
DMNDocumentationExternalLink { @JsOverlay public static DMNDocumentationExternalLink create(final String description, final String url) { final DMNDocumentationExternalLink link = new DMNDocumentationExternalLink(); link.description = description; link.url = url; return link; } private DMNDocumentationExternalLink(); ...
DMNDocumentationExternalLink { @JsOverlay public static DMNDocumentationExternalLink create(final String description, final String url) { final DMNDocumentationExternalLink link = new DMNDocumentationExternalLink(); link.description = description; link.url = url; return link; } private DMNDocumentationExternalLink(); ...
@Test public void testCreate() { final String nodeUUID1 = "1111-1111-1111-1111"; final String nodeUUID2 = "2222-2222-2222-2222"; final Node<View, Edge> node1 = new NodeImpl<>(nodeUUID1); final Node<View, Edge> node2 = new NodeImpl<>(nodeUUID2); final View view1 = mock(View.class); final View view2 = mock(View.class); f...
public List<DMNDocumentationDRD> create(final Diagram diagram) { final Optional<String> previousNodeUUID = getExpressionContainerGrid().getNodeUUID(); final List<DMNDocumentationDRD> drds = createDMNDocumentationDRDs(diagram); previousNodeUUID.ifPresent(uuid -> setExpressionContainerGrid(diagram, uuid)); return drds; }
DMNDocumentationDRDsFactory { public List<DMNDocumentationDRD> create(final Diagram diagram) { final Optional<String> previousNodeUUID = getExpressionContainerGrid().getNodeUUID(); final List<DMNDocumentationDRD> drds = createDMNDocumentationDRDs(diagram); previousNodeUUID.ifPresent(uuid -> setExpressionContainerGrid(d...
DMNDocumentationDRDsFactory { public List<DMNDocumentationDRD> create(final Diagram diagram) { final Optional<String> previousNodeUUID = getExpressionContainerGrid().getNodeUUID(); final List<DMNDocumentationDRD> drds = createDMNDocumentationDRDs(diagram); previousNodeUUID.ifPresent(uuid -> setExpressionContainerGrid(d...
DMNDocumentationDRDsFactory { public List<DMNDocumentationDRD> create(final Diagram diagram) { final Optional<String> previousNodeUUID = getExpressionContainerGrid().getNodeUUID(); final List<DMNDocumentationDRD> drds = createDMNDocumentationDRDs(diagram); previousNodeUUID.ifPresent(uuid -> setExpressionContainerGrid(d...
DMNDocumentationDRDsFactory { public List<DMNDocumentationDRD> create(final Diagram diagram) { final Optional<String> previousNodeUUID = getExpressionContainerGrid().getNodeUUID(); final List<DMNDocumentationDRD> drds = createDMNDocumentationDRDs(diagram); previousNodeUUID.ifPresent(uuid -> setExpressionContainerGrid(d...
@Test public void testGetNodeImage() { final String uuid = "0000-1111-2222-3333"; final Node<View, Edge> node = new NodeImpl<>(uuid); final HasExpression hasExpression = mock(HasExpression.class); final String expectedImage = "<image>"; final double wide = 800; final double high = 600; doNothing().when(factory).setExpr...
String getNodeImage(final Diagram diagram, final Node<View, Edge> node) { if (!hasExpression(node)) { return NONE; } setExpressionContainerGrid(diagram, node.getUUID()); final ExpressionContainerGrid grid = getExpressionContainerGrid(); final Viewport viewport = grid.getViewport(); final int padding = 10; final int wid...
DMNDocumentationDRDsFactory { String getNodeImage(final Diagram diagram, final Node<View, Edge> node) { if (!hasExpression(node)) { return NONE; } setExpressionContainerGrid(diagram, node.getUUID()); final ExpressionContainerGrid grid = getExpressionContainerGrid(); final Viewport viewport = grid.getViewport(); final i...
DMNDocumentationDRDsFactory { String getNodeImage(final Diagram diagram, final Node<View, Edge> node) { if (!hasExpression(node)) { return NONE; } setExpressionContainerGrid(diagram, node.getUUID()); final ExpressionContainerGrid grid = getExpressionContainerGrid(); final Viewport viewport = grid.getViewport(); final i...
DMNDocumentationDRDsFactory { String getNodeImage(final Diagram diagram, final Node<View, Edge> node) { if (!hasExpression(node)) { return NONE; } setExpressionContainerGrid(diagram, node.getUUID()); final ExpressionContainerGrid grid = getExpressionContainerGrid(); final Viewport viewport = grid.getViewport(); final i...
DMNDocumentationDRDsFactory { String getNodeImage(final Diagram diagram, final Node<View, Edge> node) { if (!hasExpression(node)) { return NONE; } setExpressionContainerGrid(diagram, node.getUUID()); final ExpressionContainerGrid grid = getExpressionContainerGrid(); final Viewport viewport = grid.getViewport(); final i...
@Test public void testParseFunctionInvocation_MissingEnd() { final RangeValue rangeValue = service.parseRangeValue("[date(\"2018-01-01\")..]"); assertNotNull(rangeValue); assertEquals("", rangeValue.getStartValue()); assertEquals("", rangeValue.getEndValue()); }
@Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { final RangeNode rangeNode = (RangeNode) baseNode; ...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
@Test public void testSetExpressionContainerGrid() { final String uuid = "0000-1111-2222-3333"; final String name = "Decision-1"; final Node<View, Edge> node = new NodeImpl<>(uuid); final Decision drgElement = new Decision(); final HasExpression hasExpression = mock(HasExpression.class); final View view = mock(View.cla...
void setExpressionContainerGrid(final Diagram diagram, final String uuid) { final Node<View, Edge> node = getNode(diagram, uuid); final Object definition = DefinitionUtils.getElementDefinition(node); final HasExpression hasExpression = expressionHelper.getHasExpression(node); final Optional<HasName> hasName = Optional....
DMNDocumentationDRDsFactory { void setExpressionContainerGrid(final Diagram diagram, final String uuid) { final Node<View, Edge> node = getNode(diagram, uuid); final Object definition = DefinitionUtils.getElementDefinition(node); final HasExpression hasExpression = expressionHelper.getHasExpression(node); final Optiona...
DMNDocumentationDRDsFactory { void setExpressionContainerGrid(final Diagram diagram, final String uuid) { final Node<View, Edge> node = getNode(diagram, uuid); final Object definition = DefinitionUtils.getElementDefinition(node); final HasExpression hasExpression = expressionHelper.getHasExpression(node); final Optiona...
DMNDocumentationDRDsFactory { void setExpressionContainerGrid(final Diagram diagram, final String uuid) { final Node<View, Edge> node = getNode(diagram, uuid); final Object definition = DefinitionUtils.getElementDefinition(node); final HasExpression hasExpression = expressionHelper.getHasExpression(node); final Optiona...
DMNDocumentationDRDsFactory { void setExpressionContainerGrid(final Diagram diagram, final String uuid) { final Node<View, Edge> node = getNode(diagram, uuid); final Object definition = DefinitionUtils.getElementDefinition(node); final HasExpression hasExpression = expressionHelper.getHasExpression(node); final Optiona...
@Test public void testClearSelections() { factory.clearSelections(expressionContainerGrid); verify(expressionGrid.getModel()).clearSelections(); verify(expressionGrid).draw(); }
void clearSelections(final ExpressionContainerGrid grid) { grid.getBaseExpressionGrid().ifPresent(expressionGrid -> { expressionGrid.getModel().clearSelections(); expressionGrid.draw(); }); }
DMNDocumentationDRDsFactory { void clearSelections(final ExpressionContainerGrid grid) { grid.getBaseExpressionGrid().ifPresent(expressionGrid -> { expressionGrid.getModel().clearSelections(); expressionGrid.draw(); }); } }
DMNDocumentationDRDsFactory { void clearSelections(final ExpressionContainerGrid grid) { grid.getBaseExpressionGrid().ifPresent(expressionGrid -> { expressionGrid.getModel().clearSelections(); expressionGrid.draw(); }); } @Inject DMNDocumentationDRDsFactory(final SessionManager sessionManager, ...
DMNDocumentationDRDsFactory { void clearSelections(final ExpressionContainerGrid grid) { grid.getBaseExpressionGrid().ifPresent(expressionGrid -> { expressionGrid.getModel().clearSelections(); expressionGrid.draw(); }); } @Inject DMNDocumentationDRDsFactory(final SessionManager sessionManager, ...
DMNDocumentationDRDsFactory { void clearSelections(final ExpressionContainerGrid grid) { grid.getBaseExpressionGrid().ifPresent(expressionGrid -> { expressionGrid.getModel().clearSelections(); expressionGrid.draw(); }); } @Inject DMNDocumentationDRDsFactory(final SessionManager sessionManager, ...
@Test public void testGetNodeImageWhenNodeDoesNotHaveExpression() { final String uuid = "0000-1111-2222-3333"; final Node<View, Edge> node = new NodeImpl<>(uuid); when(expressionHelper.getOptionalHasExpression(node)).thenReturn(Optional.empty()); final String image = factory.getNodeImage(diagram, node); assertEquals(NO...
String getNodeImage(final Diagram diagram, final Node<View, Edge> node) { if (!hasExpression(node)) { return NONE; } setExpressionContainerGrid(diagram, node.getUUID()); final ExpressionContainerGrid grid = getExpressionContainerGrid(); final Viewport viewport = grid.getViewport(); final int padding = 10; final int wid...
DMNDocumentationDRDsFactory { String getNodeImage(final Diagram diagram, final Node<View, Edge> node) { if (!hasExpression(node)) { return NONE; } setExpressionContainerGrid(diagram, node.getUUID()); final ExpressionContainerGrid grid = getExpressionContainerGrid(); final Viewport viewport = grid.getViewport(); final i...
DMNDocumentationDRDsFactory { String getNodeImage(final Diagram diagram, final Node<View, Edge> node) { if (!hasExpression(node)) { return NONE; } setExpressionContainerGrid(diagram, node.getUUID()); final ExpressionContainerGrid grid = getExpressionContainerGrid(); final Viewport viewport = grid.getViewport(); final i...
DMNDocumentationDRDsFactory { String getNodeImage(final Diagram diagram, final Node<View, Edge> node) { if (!hasExpression(node)) { return NONE; } setExpressionContainerGrid(diagram, node.getUUID()); final ExpressionContainerGrid grid = getExpressionContainerGrid(); final Viewport viewport = grid.getViewport(); final i...
DMNDocumentationDRDsFactory { String getNodeImage(final Diagram diagram, final Node<View, Edge> node) { if (!hasExpression(node)) { return NONE; } setExpressionContainerGrid(diagram, node.getUUID()); final ExpressionContainerGrid grid = getExpressionContainerGrid(); final Viewport viewport = grid.getViewport(); final i...
@Test public void testProcessDocumentation() { final DMNDocumentation expectedDocumentation = mock(DMNDocumentation.class); when(dmnDocumentationFactory.create(diagram)).thenReturn(expectedDocumentation); final DMNDocumentation actualDocumentation = service.processDocumentation(diagram); assertEquals(expectedDocumentat...
@Override public DMNDocumentation processDocumentation(final Diagram diagram) { return dmnDocumentationFactory.create(diagram); }
DMNDocumentationServiceImpl implements DMNDocumentationService { @Override public DMNDocumentation processDocumentation(final Diagram diagram) { return dmnDocumentationFactory.create(diagram); } }
DMNDocumentationServiceImpl implements DMNDocumentationService { @Override public DMNDocumentation processDocumentation(final Diagram diagram) { return dmnDocumentationFactory.create(diagram); } @Inject DMNDocumentationServiceImpl(final ClientMustacheTemplateRenderer mustacheTemplateRenderer, ...
DMNDocumentationServiceImpl implements DMNDocumentationService { @Override public DMNDocumentation processDocumentation(final Diagram diagram) { return dmnDocumentationFactory.create(diagram); } @Inject DMNDocumentationServiceImpl(final ClientMustacheTemplateRenderer mustacheTemplateRenderer, ...
DMNDocumentationServiceImpl implements DMNDocumentationService { @Override public DMNDocumentation processDocumentation(final Diagram diagram) { return dmnDocumentationFactory.create(diagram); } @Inject DMNDocumentationServiceImpl(final ClientMustacheTemplateRenderer mustacheTemplateRenderer, ...
@Test public void testGetDocumentationTemplate() { final HTMLDocumentationTemplate documentationTemplate = service.getDocumentationTemplate(); final String expectedTemplate = "documentationTemplate"; final String actualTemplate = documentationTemplate.getTemplate(); assertEquals(expectedTemplate, actualTemplate); }
@Override public HTMLDocumentationTemplate getDocumentationTemplate() { final DMNDocumentationTemplateSource source = GWT.create(DMNDocumentationTemplateSource.class); return new HTMLDocumentationTemplate(source.documentationTemplate().getText()); }
DMNDocumentationServiceImpl implements DMNDocumentationService { @Override public HTMLDocumentationTemplate getDocumentationTemplate() { final DMNDocumentationTemplateSource source = GWT.create(DMNDocumentationTemplateSource.class); return new HTMLDocumentationTemplate(source.documentationTemplate().getText()); } }
DMNDocumentationServiceImpl implements DMNDocumentationService { @Override public HTMLDocumentationTemplate getDocumentationTemplate() { final DMNDocumentationTemplateSource source = GWT.create(DMNDocumentationTemplateSource.class); return new HTMLDocumentationTemplate(source.documentationTemplate().getText()); } @Inje...
DMNDocumentationServiceImpl implements DMNDocumentationService { @Override public HTMLDocumentationTemplate getDocumentationTemplate() { final DMNDocumentationTemplateSource source = GWT.create(DMNDocumentationTemplateSource.class); return new HTMLDocumentationTemplate(source.documentationTemplate().getText()); } @Inje...
DMNDocumentationServiceImpl implements DMNDocumentationService { @Override public HTMLDocumentationTemplate getDocumentationTemplate() { final DMNDocumentationTemplateSource source = GWT.create(DMNDocumentationTemplateSource.class); return new HTMLDocumentationTemplate(source.documentationTemplate().getText()); } @Inje...
@Test public void testBuildDocumentation() { final HTMLDocumentationTemplate template = mock(HTMLDocumentationTemplate.class); final DMNDocumentation documentation = mock(DMNDocumentation.class); final String documentationTemplate = "documentationTemplate"; final String rendered = "<template rendered='true' />"; final ...
@Override public DocumentationOutput buildDocumentation(final HTMLDocumentationTemplate template, final DMNDocumentation diagramDocumentation) { final String rendered = mustacheTemplateRenderer.render(template.getTemplate(), diagramDocumentation); return new DocumentationOutput(rendered); }
DMNDocumentationServiceImpl implements DMNDocumentationService { @Override public DocumentationOutput buildDocumentation(final HTMLDocumentationTemplate template, final DMNDocumentation diagramDocumentation) { final String rendered = mustacheTemplateRenderer.render(template.getTemplate(), diagramDocumentation); return ...
DMNDocumentationServiceImpl implements DMNDocumentationService { @Override public DocumentationOutput buildDocumentation(final HTMLDocumentationTemplate template, final DMNDocumentation diagramDocumentation) { final String rendered = mustacheTemplateRenderer.render(template.getTemplate(), diagramDocumentation); return ...
DMNDocumentationServiceImpl implements DMNDocumentationService { @Override public DocumentationOutput buildDocumentation(final HTMLDocumentationTemplate template, final DMNDocumentation diagramDocumentation) { final String rendered = mustacheTemplateRenderer.render(template.getTemplate(), diagramDocumentation); return ...
DMNDocumentationServiceImpl implements DMNDocumentationService { @Override public DocumentationOutput buildDocumentation(final HTMLDocumentationTemplate template, final DMNDocumentation diagramDocumentation) { final String rendered = mustacheTemplateRenderer.render(template.getTemplate(), diagramDocumentation); return ...
@Test public void testGenerateWhenDiagramIsNotPresent() { final DocumentationOutput expectedOutput = DocumentationOutput.EMPTY; final DocumentationOutput actualOutput = service.generate(null); assertEquals(expectedOutput, actualOutput); }
@Override public DocumentationOutput generate(final Diagram diagram) { return Optional.ofNullable(diagram) .map(this::processDocumentation) .map(dmnDocumentation -> buildDocumentation(getDocumentationTemplate(), dmnDocumentation)) .orElse(EMPTY); }
DMNDocumentationServiceImpl implements DMNDocumentationService { @Override public DocumentationOutput generate(final Diagram diagram) { return Optional.ofNullable(diagram) .map(this::processDocumentation) .map(dmnDocumentation -> buildDocumentation(getDocumentationTemplate(), dmnDocumentation)) .orElse(EMPTY); } }
DMNDocumentationServiceImpl implements DMNDocumentationService { @Override public DocumentationOutput generate(final Diagram diagram) { return Optional.ofNullable(diagram) .map(this::processDocumentation) .map(dmnDocumentation -> buildDocumentation(getDocumentationTemplate(), dmnDocumentation)) .orElse(EMPTY); } @Injec...
DMNDocumentationServiceImpl implements DMNDocumentationService { @Override public DocumentationOutput generate(final Diagram diagram) { return Optional.ofNullable(diagram) .map(this::processDocumentation) .map(dmnDocumentation -> buildDocumentation(getDocumentationTemplate(), dmnDocumentation)) .orElse(EMPTY); } @Injec...
DMNDocumentationServiceImpl implements DMNDocumentationService { @Override public DocumentationOutput generate(final Diagram diagram) { return Optional.ofNullable(diagram) .map(this::processDocumentation) .map(dmnDocumentation -> buildDocumentation(getDocumentationTemplate(), dmnDocumentation)) .orElse(EMPTY); } @Injec...
@Test public void testCreate() { final String diagramName = "Diagram name"; final String diagramDescription = "Diagram description"; final String image = "<image>"; final String admin = "admin"; final String currentDate = "2 January 1992"; final String namespace = ": final String expectedDroolsLogo = "droolsLogo"; fina...
public DMNDocumentation create(final Diagram diagram) { return DMNDocumentation.create(getNamespace(diagram), getDiagramName(diagram), getDiagramDescription(diagram), hasGraphNodes(diagram), getDataTypes(diagram), getDrds(diagram), getDiagramImage(), getCurrentUserName(), getCurrentDate(), getDocumentationI18n()); }
DMNDocumentationFactory { public DMNDocumentation create(final Diagram diagram) { return DMNDocumentation.create(getNamespace(diagram), getDiagramName(diagram), getDiagramDescription(diagram), hasGraphNodes(diagram), getDataTypes(diagram), getDrds(diagram), getDiagramImage(), getCurrentUserName(), getCurrentDate(), get...
DMNDocumentationFactory { public DMNDocumentation create(final Diagram diagram) { return DMNDocumentation.create(getNamespace(diagram), getDiagramName(diagram), getDiagramDescription(diagram), hasGraphNodes(diagram), getDataTypes(diagram), getDrds(diagram), getDiagramImage(), getCurrentUserName(), getCurrentDate(), get...
DMNDocumentationFactory { public DMNDocumentation create(final Diagram diagram) { return DMNDocumentation.create(getNamespace(diagram), getDiagramName(diagram), getDiagramDescription(diagram), hasGraphNodes(diagram), getDataTypes(diagram), getDrds(diagram), getDiagramImage(), getCurrentUserName(), getCurrentDate(), get...
DMNDocumentationFactory { public DMNDocumentation create(final Diagram diagram) { return DMNDocumentation.create(getNamespace(diagram), getDiagramName(diagram), getDiagramDescription(diagram), hasGraphNodes(diagram), getDataTypes(diagram), getDrds(diagram), getDiagramImage(), getCurrentUserName(), getCurrentDate(), get...
@Test public void testGetDiagramImageWhenCanvasHandlerIsNotPresent() { when(graphUtils.getCurrentSession()).thenReturn(Optional.empty()); assertEquals(EMPTY, documentationFactory.getDiagramImage()); }
protected String getDiagramImage() { return getCanvasHandler() .map(canvasFileExport::exportToPng) .orElse(EMPTY); }
DMNDocumentationFactory { protected String getDiagramImage() { return getCanvasHandler() .map(canvasFileExport::exportToPng) .orElse(EMPTY); } }
DMNDocumentationFactory { protected String getDiagramImage() { return getCanvasHandler() .map(canvasFileExport::exportToPng) .orElse(EMPTY); } @Inject DMNDocumentationFactory(final CanvasFileExport canvasFileExport, final TranslationService translationService, ...
DMNDocumentationFactory { protected String getDiagramImage() { return getCanvasHandler() .map(canvasFileExport::exportToPng) .orElse(EMPTY); } @Inject DMNDocumentationFactory(final CanvasFileExport canvasFileExport, final TranslationService translationService, ...
DMNDocumentationFactory { protected String getDiagramImage() { return getCanvasHandler() .map(canvasFileExport::exportToPng) .orElse(EMPTY); } @Inject DMNDocumentationFactory(final CanvasFileExport canvasFileExport, final TranslationService translationService, ...
@Test public void testGetHasGraphNodesWhenIsReturnsFalse() { when(graphUtils.getDRGElements(diagram)).thenReturn(emptyList()); assertFalse(documentationFactory.hasGraphNodes(diagram)); }
protected boolean hasGraphNodes(final Diagram diagram) { return !graphUtils.getDRGElements(diagram).isEmpty(); }
DMNDocumentationFactory { protected boolean hasGraphNodes(final Diagram diagram) { return !graphUtils.getDRGElements(diagram).isEmpty(); } }
DMNDocumentationFactory { protected boolean hasGraphNodes(final Diagram diagram) { return !graphUtils.getDRGElements(diagram).isEmpty(); } @Inject DMNDocumentationFactory(final CanvasFileExport canvasFileExport, final TranslationService translationService, ...
DMNDocumentationFactory { protected boolean hasGraphNodes(final Diagram diagram) { return !graphUtils.getDRGElements(diagram).isEmpty(); } @Inject DMNDocumentationFactory(final CanvasFileExport canvasFileExport, final TranslationService translationService, ...
DMNDocumentationFactory { protected boolean hasGraphNodes(final Diagram diagram) { return !graphUtils.getDRGElements(diagram).isEmpty(); } @Inject DMNDocumentationFactory(final CanvasFileExport canvasFileExport, final TranslationService translationService, ...
@Test public void testParseWithInteger() { final RangeValue rangeValue = service.parseRangeValue("[0..5]"); assertTrue(rangeValue.getIncludeStartValue()); assertTrue(rangeValue.getIncludeEndValue()); assertEquals("0", rangeValue.getStartValue()); assertEquals("5", rangeValue.getEndValue()); }
@Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { final RangeNode rangeNode = (RangeNode) baseNode; ...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
@Test public void testGetHasGraphNodesWhenIsReturnsTrue() { when(graphUtils.getDRGElements(diagram)).thenReturn(singletonList(mock(DRGElement.class))); assertTrue(documentationFactory.hasGraphNodes(diagram)); }
protected boolean hasGraphNodes(final Diagram diagram) { return !graphUtils.getDRGElements(diagram).isEmpty(); }
DMNDocumentationFactory { protected boolean hasGraphNodes(final Diagram diagram) { return !graphUtils.getDRGElements(diagram).isEmpty(); } }
DMNDocumentationFactory { protected boolean hasGraphNodes(final Diagram diagram) { return !graphUtils.getDRGElements(diagram).isEmpty(); } @Inject DMNDocumentationFactory(final CanvasFileExport canvasFileExport, final TranslationService translationService, ...
DMNDocumentationFactory { protected boolean hasGraphNodes(final Diagram diagram) { return !graphUtils.getDRGElements(diagram).isEmpty(); } @Inject DMNDocumentationFactory(final CanvasFileExport canvasFileExport, final TranslationService translationService, ...
DMNDocumentationFactory { protected boolean hasGraphNodes(final Diagram diagram) { return !graphUtils.getDRGElements(diagram).isEmpty(); } @Inject DMNDocumentationFactory(final CanvasFileExport canvasFileExport, final TranslationService translationService, ...
@Test public void testCreate() { when(translationService.format(DMNDocumentationI18n_DmnModelDocumentation)).thenReturn("DMN model documentation"); when(translationService.format(DMNDocumentationI18n_GeneratedOn)).thenReturn("Generated on:"); when(translationService.format(DMNDocumentationI18n_GeneratedBy)).thenReturn(...
@JsOverlay public static DMNDocumentationI18n create(final TranslationService translationService) { final DMNDocumentationI18n i18n = new DMNDocumentationI18n(); i18n.dmnModelDocumentation = translationService.format(DMNDocumentationI18n_DmnModelDocumentation); i18n.generatedOn = translationService.format(DMNDocumentat...
DMNDocumentationI18n { @JsOverlay public static DMNDocumentationI18n create(final TranslationService translationService) { final DMNDocumentationI18n i18n = new DMNDocumentationI18n(); i18n.dmnModelDocumentation = translationService.format(DMNDocumentationI18n_DmnModelDocumentation); i18n.generatedOn = translationServi...
DMNDocumentationI18n { @JsOverlay public static DMNDocumentationI18n create(final TranslationService translationService) { final DMNDocumentationI18n i18n = new DMNDocumentationI18n(); i18n.dmnModelDocumentation = translationService.format(DMNDocumentationI18n_DmnModelDocumentation); i18n.generatedOn = translationServi...
DMNDocumentationI18n { @JsOverlay public static DMNDocumentationI18n create(final TranslationService translationService) { final DMNDocumentationI18n i18n = new DMNDocumentationI18n(); i18n.dmnModelDocumentation = translationService.format(DMNDocumentationI18n_DmnModelDocumentation); i18n.generatedOn = translationServi...
DMNDocumentationI18n { @JsOverlay public static DMNDocumentationI18n create(final TranslationService translationService) { final DMNDocumentationI18n i18n = new DMNDocumentationI18n(); i18n.dmnModelDocumentation = translationService.format(DMNDocumentationI18n_DmnModelDocumentation); i18n.generatedOn = translationServi...
@Test public void testInit() { final String url = "url"; final String name = "name"; final String urlPlaceholder = "urlPlaceholder"; final String namePlaceholder = "namePlaceholder"; when(translationService.getTranslation(DMNDocumentationI18n_URL)).thenReturn(url); when(translationService.getTranslation(DMNDocumentatio...
@PostConstruct public void init() { okButton.disabled = true; urlLabel.textContent = translationService.getTranslation(DMNDocumentationI18n_URL); attachmentName.textContent = translationService.getTranslation(DMNDocumentationI18n_Name); urlInput.placeholder = translationService.getTranslation(DMNDocumentationI18n_URLPl...
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { @PostConstruct public void init() { okButton.disabled = true; urlLabel.textContent = translationService.getTranslation(DMNDocumentationI18n_URL); attachmentName.textContent = translationService.getTranslation(DMNDocumentationI1...
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { @PostConstruct public void init() { okButton.disabled = true; urlLabel.textContent = translationService.getTranslation(DMNDocumentationI18n_URL); attachmentName.textContent = translationService.getTranslation(DMNDocumentationI1...
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { @PostConstruct public void init() { okButton.disabled = true; urlLabel.textContent = translationService.getTranslation(DMNDocumentationI18n_URL); attachmentName.textContent = translationService.getTranslation(DMNDocumentationI1...
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { @PostConstruct public void init() { okButton.disabled = true; urlLabel.textContent = translationService.getTranslation(DMNDocumentationI18n_URL); attachmentName.textContent = translationService.getTranslation(DMNDocumentationI1...
@Test public void testOnClickOkButton() { final String description = "description"; final String url = "url"; final ArgumentCaptor<DMNExternalLink> captor = ArgumentCaptor.forClass(DMNExternalLink.class); final Consumer onExternalLinkCreated = mock(Consumer.class); attachmentNameInput.value = description; urlInput.valu...
@EventHandler("okButton") @SuppressWarnings("unused") public void onClickOkButton(final ClickEvent clickEvent) { final Consumer<DMNExternalLink> consumer = getOnExternalLinkCreated(); if (!Objects.isNull(consumer)) { final String description = attachmentNameInput.value; final String url = urlInput.value; final DMNExter...
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { @EventHandler("okButton") @SuppressWarnings("unused") public void onClickOkButton(final ClickEvent clickEvent) { final Consumer<DMNExternalLink> consumer = getOnExternalLinkCreated(); if (!Objects.isNull(consumer)) { final Stri...
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { @EventHandler("okButton") @SuppressWarnings("unused") public void onClickOkButton(final ClickEvent clickEvent) { final Consumer<DMNExternalLink> consumer = getOnExternalLinkCreated(); if (!Objects.isNull(consumer)) { final Stri...
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { @EventHandler("okButton") @SuppressWarnings("unused") public void onClickOkButton(final ClickEvent clickEvent) { final Consumer<DMNExternalLink> consumer = getOnExternalLinkCreated(); if (!Objects.isNull(consumer)) { final Stri...
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { @EventHandler("okButton") @SuppressWarnings("unused") public void onClickOkButton(final ClickEvent clickEvent) { final Consumer<DMNExternalLink> consumer = getOnExternalLinkCreated(); if (!Objects.isNull(consumer)) { final Stri...
@Test public void testOnClickCancelButton() { popover.onClickCancelButton(null); verify(popover).hide(); }
@EventHandler("cancelButton") @SuppressWarnings("unused") public void onClickCancelButton(final ClickEvent clickEvent) { hide(); }
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { @EventHandler("cancelButton") @SuppressWarnings("unused") public void onClickCancelButton(final ClickEvent clickEvent) { hide(); } }
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { @EventHandler("cancelButton") @SuppressWarnings("unused") public void onClickCancelButton(final ClickEvent clickEvent) { hide(); } NameAndUrlPopoverViewImpl(); @Inject NameAndUrlPopoverViewImpl(final Div popoverElement, ...
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { @EventHandler("cancelButton") @SuppressWarnings("unused") public void onClickCancelButton(final ClickEvent clickEvent) { hide(); } NameAndUrlPopoverViewImpl(); @Inject NameAndUrlPopoverViewImpl(final Div popoverElement, ...
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { @EventHandler("cancelButton") @SuppressWarnings("unused") public void onClickCancelButton(final ClickEvent clickEvent) { hide(); } NameAndUrlPopoverViewImpl(); @Inject NameAndUrlPopoverViewImpl(final Div popoverElement, ...
@Test public void testShow() { doNothing().when(popover).superShow(any()); popover.show(Optional.of("")); verify(popover).clear(); }
@Override public void show(final Optional<String> popoverTitle) { clear(); superShow(popoverTitle); }
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { @Override public void show(final Optional<String> popoverTitle) { clear(); superShow(popoverTitle); } }
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { @Override public void show(final Optional<String> popoverTitle) { clear(); superShow(popoverTitle); } NameAndUrlPopoverViewImpl(); @Inject NameAndUrlPopoverViewImpl(final Div popoverElement, ...
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { @Override public void show(final Optional<String> popoverTitle) { clear(); superShow(popoverTitle); } NameAndUrlPopoverViewImpl(); @Inject NameAndUrlPopoverViewImpl(final Div popoverElement, ...
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { @Override public void show(final Optional<String> popoverTitle) { clear(); superShow(popoverTitle); } NameAndUrlPopoverViewImpl(); @Inject NameAndUrlPopoverViewImpl(final Div popoverElement, ...
@Test public void testClear() { attachmentNameInput.value = "old"; urlInput.value = "old value"; popover.clear(); assertEquals("", attachmentNameInput.value); assertEquals("", urlInput.value); }
void clear() { attachmentNameInput.value = ""; urlInput.value = ""; }
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { void clear() { attachmentNameInput.value = ""; urlInput.value = ""; } }
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { void clear() { attachmentNameInput.value = ""; urlInput.value = ""; } NameAndUrlPopoverViewImpl(); @Inject NameAndUrlPopoverViewImpl(final Div popoverElement, final Div popoverContentElemen...
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { void clear() { attachmentNameInput.value = ""; urlInput.value = ""; } NameAndUrlPopoverViewImpl(); @Inject NameAndUrlPopoverViewImpl(final Div popoverElement, final Div popoverContentElemen...
NameAndUrlPopoverViewImpl extends AbstractPopoverViewImpl implements NameAndUrlPopoverView { void clear() { attachmentNameInput.value = ""; urlInput.value = ""; } NameAndUrlPopoverViewImpl(); @Inject NameAndUrlPopoverViewImpl(final Div popoverElement, final Div popoverContentElemen...
@Test public void testInit() { popover.init(); verify(view).init(popover); }
@PostConstruct public void init() { view.init(this); }
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @PostConstruct public void init() { view.init(this); } }
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @PostConstruct public void init() { view.init(this); } NameAndUriPopoverImpl(); @Inject NameAndUriPopoverImpl(final NameAndUrlPopoverView view); }
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @PostConstruct public void init() { view.init(this); } NameAndUriPopoverImpl(); @Inject NameAndUriPopoverImpl(final NameAndUrlPopoverView view); @PostConstruct void ini...
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @PostConstruct public void init() { view.init(this); } NameAndUriPopoverImpl(); @Inject NameAndUriPopoverImpl(final NameAndUrlPopoverView view); @PostConstruct void ini...
@Test public void testGetElement() { final HTMLElement element = mock(HTMLElement.class); when(view.getElement()).thenReturn(element); final HTMLElement actual = popover.getElement(); assertEquals(element, actual); }
@Override public HTMLElement getElement() { return view.getElement(); }
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @Override public HTMLElement getElement() { return view.getElement(); } }
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @Override public HTMLElement getElement() { return view.getElement(); } NameAndUriPopoverImpl(); @Inject NameAndUriPopoverImpl(final NameAndUrlPopoverView view); }
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @Override public HTMLElement getElement() { return view.getElement(); } NameAndUriPopoverImpl(); @Inject NameAndUriPopoverImpl(final NameAndUrlPopoverView view); @PostC...
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @Override public HTMLElement getElement() { return view.getElement(); } NameAndUriPopoverImpl(); @Inject NameAndUriPopoverImpl(final NameAndUrlPopoverView view); @PostC...
@Test public void testShow() { popover.show(); verify(view).show(Optional.ofNullable(popover.getPopoverTitle())); }
@Override public void show() { view.show(Optional.ofNullable(getPopoverTitle())); }
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @Override public void show() { view.show(Optional.ofNullable(getPopoverTitle())); } }
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @Override public void show() { view.show(Optional.ofNullable(getPopoverTitle())); } NameAndUriPopoverImpl(); @Inject NameAndUriPopoverImpl(final NameAndUrlPopoverView v...
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @Override public void show() { view.show(Optional.ofNullable(getPopoverTitle())); } NameAndUriPopoverImpl(); @Inject NameAndUriPopoverImpl(final NameAndUrlPopoverView v...
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @Override public void show() { view.show(Optional.ofNullable(getPopoverTitle())); } NameAndUriPopoverImpl(); @Inject NameAndUriPopoverImpl(final NameAndUrlPopoverView v...
@Test public void testParseExcludeStart() { final RangeValue rangeValue = service.parseRangeValue("(0..5]"); assertFalse(rangeValue.getIncludeStartValue()); }
@Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { final RangeNode rangeNode = (RangeNode) baseNode; ...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
@Test public void testHide() { popover.hide(); verify(view).hide(); }
@Override public void hide() { view.hide(); }
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @Override public void hide() { view.hide(); } }
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @Override public void hide() { view.hide(); } NameAndUriPopoverImpl(); @Inject NameAndUriPopoverImpl(final NameAndUrlPopoverView view); }
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @Override public void hide() { view.hide(); } NameAndUriPopoverImpl(); @Inject NameAndUriPopoverImpl(final NameAndUrlPopoverView view); @PostConstruct void init(); @Ove...
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @Override public void hide() { view.hide(); } NameAndUriPopoverImpl(); @Inject NameAndUriPopoverImpl(final NameAndUrlPopoverView view); @PostConstruct void init(); @Ove...
@Test public void testSetOnExternalLinkCreated() { final Consumer<DMNExternalLink> consumer = mock(Consumer.class); popover.setOnExternalLinkCreated(consumer); verify(view).setOnExternalLinkCreated(consumer); }
@Override public void setOnExternalLinkCreated(final Consumer<DMNExternalLink> onExternalLinkCreated) { view.setOnExternalLinkCreated(onExternalLinkCreated); }
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @Override public void setOnExternalLinkCreated(final Consumer<DMNExternalLink> onExternalLinkCreated) { view.setOnExternalLinkCreated(onExternalLinkCreated); } }
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @Override public void setOnExternalLinkCreated(final Consumer<DMNExternalLink> onExternalLinkCreated) { view.setOnExternalLinkCreated(onExternalLinkCreated); } NameAndUr...
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @Override public void setOnExternalLinkCreated(final Consumer<DMNExternalLink> onExternalLinkCreated) { view.setOnExternalLinkCreated(onExternalLinkCreated); } NameAndUr...
NameAndUriPopoverImpl extends AbstractPopoverImpl<NameAndUrlPopoverView, NameAndUrlPopoverView.Presenter> implements NameAndUrlPopoverView.Presenter { @Override public void setOnExternalLinkCreated(final Consumer<DMNExternalLink> onExternalLinkCreated) { view.setOnExternalLinkCreated(onExternalLinkCreated); } NameAndUr...
@Test public void testRefresh() { doNothing().when(view).setTimeout(any(), anyInt()); when(buttonsVisibilitySupplier.isButtonsVisible()).thenReturn(true); view.refresh(); verify(downloadButtonClassList, never()).add(HiddenHelper.HIDDEN_CSS_CLASS); verify(printButtonClassList, never()).add(HiddenHelper.HIDDEN_CSS_CLASS)...
@Override public DocumentationView<Diagram> refresh() { refreshDocumentationHTML(); refreshDocumentationHTMLAfter200ms(); if (!buttonsVisibilitySupplier.isButtonsVisible()) { hide(printButton); hide(downloadHtmlFile); } return this; }
DMNDocumentationView extends DefaultDiagramDocumentationView { @Override public DocumentationView<Diagram> refresh() { refreshDocumentationHTML(); refreshDocumentationHTMLAfter200ms(); if (!buttonsVisibilitySupplier.isButtonsVisible()) { hide(printButton); hide(downloadHtmlFile); } return this; } }
DMNDocumentationView extends DefaultDiagramDocumentationView { @Override public DocumentationView<Diagram> refresh() { refreshDocumentationHTML(); refreshDocumentationHTMLAfter200ms(); if (!buttonsVisibilitySupplier.isButtonsVisible()) { hide(printButton); hide(downloadHtmlFile); } return this; } @Inject DMNDocumentat...
DMNDocumentationView extends DefaultDiagramDocumentationView { @Override public DocumentationView<Diagram> refresh() { refreshDocumentationHTML(); refreshDocumentationHTMLAfter200ms(); if (!buttonsVisibilitySupplier.isButtonsVisible()) { hide(printButton); hide(downloadHtmlFile); } return this; } @Inject DMNDocumentat...
DMNDocumentationView extends DefaultDiagramDocumentationView { @Override public DocumentationView<Diagram> refresh() { refreshDocumentationHTML(); refreshDocumentationHTMLAfter200ms(); if (!buttonsVisibilitySupplier.isButtonsVisible()) { hide(printButton); hide(downloadHtmlFile); } return this; } @Inject DMNDocumentat...
@Test public void testRefreshDocumentationHTMLWhenDiagramIsPresent() { final String expectedHTML = "<html />"; final DocumentationOutput output = new DocumentationOutput(expectedHTML); doReturn(Optional.of(diagram)).when(view).getDiagram(); when(documentationService.generate(diagram)).thenReturn(output); documentationC...
void refreshDocumentationHTML() { documentationContent.innerHTML = getDocumentationHTML(); }
DMNDocumentationView extends DefaultDiagramDocumentationView { void refreshDocumentationHTML() { documentationContent.innerHTML = getDocumentationHTML(); } }
DMNDocumentationView extends DefaultDiagramDocumentationView { void refreshDocumentationHTML() { documentationContent.innerHTML = getDocumentationHTML(); } @Inject DMNDocumentationView(final HTMLDivElement documentationPanel, final HTMLDivElement documentationContent, ...
DMNDocumentationView extends DefaultDiagramDocumentationView { void refreshDocumentationHTML() { documentationContent.innerHTML = getDocumentationHTML(); } @Inject DMNDocumentationView(final HTMLDivElement documentationPanel, final HTMLDivElement documentationContent, ...
DMNDocumentationView extends DefaultDiagramDocumentationView { void refreshDocumentationHTML() { documentationContent.innerHTML = getDocumentationHTML(); } @Inject DMNDocumentationView(final HTMLDivElement documentationPanel, final HTMLDivElement documentationContent, ...
@Test public void testRefreshDocumentationHTMLWhenDiagramIsNotPresent() { final String expectedHTML = EMPTY.getValue(); doReturn(Optional.empty()).when(view).getDiagram(); documentationContent.innerHTML = "something"; view.refreshDocumentationHTML(); final String actualHTML = documentationContent.innerHTML; assertEqual...
void refreshDocumentationHTML() { documentationContent.innerHTML = getDocumentationHTML(); }
DMNDocumentationView extends DefaultDiagramDocumentationView { void refreshDocumentationHTML() { documentationContent.innerHTML = getDocumentationHTML(); } }
DMNDocumentationView extends DefaultDiagramDocumentationView { void refreshDocumentationHTML() { documentationContent.innerHTML = getDocumentationHTML(); } @Inject DMNDocumentationView(final HTMLDivElement documentationPanel, final HTMLDivElement documentationContent, ...
DMNDocumentationView extends DefaultDiagramDocumentationView { void refreshDocumentationHTML() { documentationContent.innerHTML = getDocumentationHTML(); } @Inject DMNDocumentationView(final HTMLDivElement documentationPanel, final HTMLDivElement documentationContent, ...
DMNDocumentationView extends DefaultDiagramDocumentationView { void refreshDocumentationHTML() { documentationContent.innerHTML = getDocumentationHTML(); } @Inject DMNDocumentationView(final HTMLDivElement documentationPanel, final HTMLDivElement documentationContent, ...
@Test public void testRefreshDocumentationHTMLAfter200ms() { doNothing().when(view).setTimeout(any(), anyInt()); view.refreshDocumentationHTMLAfter200ms(); verify(view).setTimeout(callback.capture(), eq(200)); callback.getValue().onInvoke(new Object()); verify(view).refreshDocumentationHTML(); }
void refreshDocumentationHTMLAfter200ms() { setTimeout((w) -> refreshDocumentationHTML(), 200); }
DMNDocumentationView extends DefaultDiagramDocumentationView { void refreshDocumentationHTMLAfter200ms() { setTimeout((w) -> refreshDocumentationHTML(), 200); } }
DMNDocumentationView extends DefaultDiagramDocumentationView { void refreshDocumentationHTMLAfter200ms() { setTimeout((w) -> refreshDocumentationHTML(), 200); } @Inject DMNDocumentationView(final HTMLDivElement documentationPanel, final HTMLDivElement documentationContent, ...
DMNDocumentationView extends DefaultDiagramDocumentationView { void refreshDocumentationHTMLAfter200ms() { setTimeout((w) -> refreshDocumentationHTML(), 200); } @Inject DMNDocumentationView(final HTMLDivElement documentationPanel, final HTMLDivElement documentationContent, ...
DMNDocumentationView extends DefaultDiagramDocumentationView { void refreshDocumentationHTMLAfter200ms() { setTimeout((w) -> refreshDocumentationHTML(), 200); } @Inject DMNDocumentationView(final HTMLDivElement documentationPanel, final HTMLDivElement documentationContent, ...
@Test public void testIsEnabled() { assertTrue(view.isEnabled()); }
@Override public boolean isEnabled() { return true; }
DMNDocumentationView extends DefaultDiagramDocumentationView { @Override public boolean isEnabled() { return true; } }
DMNDocumentationView extends DefaultDiagramDocumentationView { @Override public boolean isEnabled() { return true; } @Inject DMNDocumentationView(final HTMLDivElement documentationPanel, final HTMLDivElement documentationContent, final HTMLButtonElement p...
DMNDocumentationView extends DefaultDiagramDocumentationView { @Override public boolean isEnabled() { return true; } @Inject DMNDocumentationView(final HTMLDivElement documentationPanel, final HTMLDivElement documentationContent, final HTMLButtonElement p...
DMNDocumentationView extends DefaultDiagramDocumentationView { @Override public boolean isEnabled() { return true; } @Inject DMNDocumentationView(final HTMLDivElement documentationPanel, final HTMLDivElement documentationContent, final HTMLButtonElement p...
@Test public void testOnPrintButtonClick() { view.onPrintButtonClick(mock(ClickEvent.class)); verify(printHelper).print(documentationContent); }
@EventHandler("print-button") public void onPrintButtonClick(final ClickEvent e) { printHelper.print(documentationContent); }
DMNDocumentationView extends DefaultDiagramDocumentationView { @EventHandler("print-button") public void onPrintButtonClick(final ClickEvent e) { printHelper.print(documentationContent); } }
DMNDocumentationView extends DefaultDiagramDocumentationView { @EventHandler("print-button") public void onPrintButtonClick(final ClickEvent e) { printHelper.print(documentationContent); } @Inject DMNDocumentationView(final HTMLDivElement documentationPanel, final HTMLDivElement documen...
DMNDocumentationView extends DefaultDiagramDocumentationView { @EventHandler("print-button") public void onPrintButtonClick(final ClickEvent e) { printHelper.print(documentationContent); } @Inject DMNDocumentationView(final HTMLDivElement documentationPanel, final HTMLDivElement documen...
DMNDocumentationView extends DefaultDiagramDocumentationView { @EventHandler("print-button") public void onPrintButtonClick(final ClickEvent e) { printHelper.print(documentationContent); } @Inject DMNDocumentationView(final HTMLDivElement documentationPanel, final HTMLDivElement documen...
@Test public void testOnDownloadHtmlFile() { final String html = "<html><body>Hi</body></html>"; final String modelName = "model name"; doReturn(modelName).when(view).getCurrentDocumentationModelName(); doReturn(html).when(view).getCurrentDocumentationHTML(); view.onDownloadHtmlFile(mock(ClickEvent.class)); verify(view...
@EventHandler("download-html-file") public void onDownloadHtmlFile(final ClickEvent e) { final String html = getCurrentDocumentationHTML(); downloadHelper.download(getCurrentDocumentationModelName(), html); }
DMNDocumentationView extends DefaultDiagramDocumentationView { @EventHandler("download-html-file") public void onDownloadHtmlFile(final ClickEvent e) { final String html = getCurrentDocumentationHTML(); downloadHelper.download(getCurrentDocumentationModelName(), html); } }
DMNDocumentationView extends DefaultDiagramDocumentationView { @EventHandler("download-html-file") public void onDownloadHtmlFile(final ClickEvent e) { final String html = getCurrentDocumentationHTML(); downloadHelper.download(getCurrentDocumentationModelName(), html); } @Inject DMNDocumentationView(final HTMLDivEleme...
DMNDocumentationView extends DefaultDiagramDocumentationView { @EventHandler("download-html-file") public void onDownloadHtmlFile(final ClickEvent e) { final String html = getCurrentDocumentationHTML(); downloadHelper.download(getCurrentDocumentationModelName(), html); } @Inject DMNDocumentationView(final HTMLDivEleme...
DMNDocumentationView extends DefaultDiagramDocumentationView { @EventHandler("download-html-file") public void onDownloadHtmlFile(final ClickEvent e) { final String html = getCurrentDocumentationHTML(); downloadHelper.download(getCurrentDocumentationModelName(), html); } @Inject DMNDocumentationView(final HTMLDivEleme...
@Test public void testRenderCenteredText() throws Exception { final BaseGridCell<String> cell = new BaseGridCell<>(new BaseGridCellValue<>(VALUE)); RendererUtils.getCenteredCellText(cellContext, cell); assertCenteredRendering(text); assertNotRenderedPlaceHolder(placeHolderText); }
public static Group getCenteredCellText(final GridBodyCellRenderContext context, final GridCell<String> gridCell) { final GridRenderer gridRenderer = context.getRenderer(); final GridRendererTheme theme = gridRenderer.getTheme(); final Group g = GWT.create(Group.class); String value = gridCell.getValue().getValue(); fi...
RendererUtils { public static Group getCenteredCellText(final GridBodyCellRenderContext context, final GridCell<String> gridCell) { final GridRenderer gridRenderer = context.getRenderer(); final GridRendererTheme theme = gridRenderer.getTheme(); final Group g = GWT.create(Group.class); String value = gridCell.getValue(...
RendererUtils { public static Group getCenteredCellText(final GridBodyCellRenderContext context, final GridCell<String> gridCell) { final GridRenderer gridRenderer = context.getRenderer(); final GridRendererTheme theme = gridRenderer.getTheme(); final Group g = GWT.create(Group.class); String value = gridCell.getValue(...
RendererUtils { public static Group getCenteredCellText(final GridBodyCellRenderContext context, final GridCell<String> gridCell) { final GridRenderer gridRenderer = context.getRenderer(); final GridRendererTheme theme = gridRenderer.getTheme(); final Group g = GWT.create(Group.class); String value = gridCell.getValue(...
RendererUtils { public static Group getCenteredCellText(final GridBodyCellRenderContext context, final GridCell<String> gridCell) { final GridRenderer gridRenderer = context.getRenderer(); final GridRendererTheme theme = gridRenderer.getTheme(); final Group g = GWT.create(Group.class); String value = gridCell.getValue(...
@Test public void testParseExcludeEnd() { final RangeValue rangeValue = service.parseRangeValue("[0..5)"); assertFalse(rangeValue.getIncludeEndValue()); }
@Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { final RangeNode rangeNode = (RangeNode) baseNode; ...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
DMNParseServiceImpl implements DMNParseService { @Override public RangeValue parseRangeValue(final String source) { final FEEL_1_1Parser parser = makeParser(source); final BaseNode baseNode = makeVisitor().visit(parser.expression()); final RangeValue rangeValue = new RangeValue(); if (baseNode instanceof RangeNode) { f...
@Test public void constructContent() { service.constructContent(path, null); final String actual = "<xml/>"; doReturn(actual).when(service).getSource(path); final String expected = service.constructContent(path, null); assertEquals(expected, actual); }
@Override protected String constructContent(final Path path, final Overview _overview) { return getSource(path); }
DMNContentServiceImpl extends KieService<String> implements DMNContentService { @Override protected String constructContent(final Path path, final Overview _overview) { return getSource(path); } }
DMNContentServiceImpl extends KieService<String> implements DMNContentService { @Override protected String constructContent(final Path path, final Overview _overview) { return getSource(path); } @Inject DMNContentServiceImpl(final CommentedOptionFactory commentedOptionFactory, final DM...
DMNContentServiceImpl extends KieService<String> implements DMNContentService { @Override protected String constructContent(final Path path, final Overview _overview) { return getSource(path); } @Inject DMNContentServiceImpl(final CommentedOptionFactory commentedOptionFactory, final DM...
DMNContentServiceImpl extends KieService<String> implements DMNContentService { @Override protected String constructContent(final Path path, final Overview _overview) { return getSource(path); } @Inject DMNContentServiceImpl(final CommentedOptionFactory commentedOptionFactory, final DM...
@Test void listRooms() { mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withSuccess(new ClassPathResource("/room/rooms.json", getClass()), APPLICATION_JSON)); final List<Room> rooms = roomResource.listRooms(); assertThat(rooms).isEqualTo(RoomMother.rooms()); }
@Override public List<Room> listRooms() { return Arrays.asList(restTemplate.getForEntity("https: }
RoomResourceTemplate implements RoomResource { @Override public List<Room> listRooms() { return Arrays.asList(restTemplate.getForEntity("https: } }
RoomResourceTemplate implements RoomResource { @Override public List<Room> listRooms() { return Arrays.asList(restTemplate.getForEntity("https: } RoomResourceTemplate(final RestTemplate restTemplate); }
RoomResourceTemplate implements RoomResource { @Override public List<Room> listRooms() { return Arrays.asList(restTemplate.getForEntity("https: } RoomResourceTemplate(final RestTemplate restTemplate); @Override List<Room> listRooms(); }
RoomResourceTemplate implements RoomResource { @Override public List<Room> listRooms() { return Arrays.asList(restTemplate.getForEntity("https: } RoomResourceTemplate(final RestTemplate restTemplate); @Override List<Room> listRooms(); }
@Test public void claimableResult_currentStatusClaimable() { final String owner = "FundRequest"; final String repo = "area51"; final String number = "983"; final String solver = "davyvanroy"; when(githubScraper.fetchGithubIssue(owner, repo, number)).thenReturn(GithubIssue.builder() .solver(solver) .status("Closed") .bu...
public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requestStatus == FUNDED ||...
GithubClaimResolver { public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requ...
GithubClaimResolver { public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requ...
GithubClaimResolver { public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requ...
GithubClaimResolver { public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requ...
@Test public void claimableResult_currentStatusFunded() { final String owner = "FundRequest"; final String repo = "area51"; final String number = "983"; final String solver = "davyvanroy"; when(githubScraper.fetchGithubIssue(owner, repo, number)).thenReturn(GithubIssue.builder() .solver(solver) .status("Closed") .build...
public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requestStatus == FUNDED ||...
GithubClaimResolver { public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requ...
GithubClaimResolver { public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requ...
GithubClaimResolver { public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requ...
GithubClaimResolver { public ClaimableResultDto claimableResult(final String owner, final String repo, final String number, final RequestStatus requestStatus) { final GithubIssue githubIssue = githubScraper.fetchGithubIssue(owner, repo, number); if (isIssueClosed(githubIssue) && githubIssue.getSolver() != null && (requ...
@Test public void canClaim() { final Principal principal = PrincipalMother.davyvanroy(); final RequestDto requestDto = RequestDtoMother.fundRequestArea51(); final IssueInformationDto issueInformation = requestDto.getIssueInformation(); when(githubScraper.fetchGithubIssue(issueInformation.getOwner(), issueInformation.ge...
public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = githubScraper.fetchGithub...
GithubClaimResolver { public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = git...
GithubClaimResolver { public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = git...
GithubClaimResolver { public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = git...
GithubClaimResolver { public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = git...
@Test public void canClaim_differentUser() { final Principal principal = PrincipalMother.davyvanroy(); final RequestDto requestDto = RequestDtoMother.fundRequestArea51(); final IssueInformationDto issueInformation = requestDto.getIssueInformation(); when(githubScraper.fetchGithubIssue(issueInformation.getOwner(), issue...
public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = githubScraper.fetchGithub...
GithubClaimResolver { public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = git...
GithubClaimResolver { public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = git...
GithubClaimResolver { public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = git...
GithubClaimResolver { public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = git...
@Test public void canClaim_issueNotClosed() { final Principal principal = PrincipalMother.davyvanroy(); final RequestDto requestDto = RequestDtoMother.fundRequestArea51(); final IssueInformationDto issueInformation = requestDto.getIssueInformation(); when(githubScraper.fetchGithubIssue(issueInformation.getOwner(), issu...
public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = githubScraper.fetchGithub...
GithubClaimResolver { public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = git...
GithubClaimResolver { public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = git...
GithubClaimResolver { public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = git...
GithubClaimResolver { public Boolean canClaim(final Principal user, final RequestDto request) { final String owner = request.getIssueInformation().getOwner(); final String repo = request.getIssueInformation().getRepo(); final String number = request.getIssueInformation().getNumber(); final GithubIssue githubIssue = git...
@Test public void getUsdPriceOneCryptoCompare() { TokenValueDto totalFund = TokenValueDto.builder().tokenAddress("0x0").tokenSymbol("FND").totalAmount(BigDecimal.TEN).build(); when(coinMarketCapService.getCurrentPriceInUsd("FND")).thenReturn(Optional.empty()); when(cryptoCompareService.getCurrentPriceInUsd("FND")).then...
public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); }
FiatService { public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); } }
FiatService { public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); } FiatService(CryptoCompareService cryptoCompareService, CoinMarketCapService coinMarketCapService); }
FiatService { public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); } FiatService(CryptoCompareService cryptoCompareService, CoinMarketCapService coinMarketCapService); doubl...
FiatService { public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); } FiatService(CryptoCompareService cryptoCompareService, CoinMarketCapService coinMarketCapService); doubl...
@Test public void getUsdPriceMultipleCryptoCompare() { TokenValueDto totalFund1 = TokenValueDto.builder().tokenAddress("0x0").tokenSymbol("FND").totalAmount(new BigDecimal("8457.858")).build(); TokenValueDto totalFund2 = TokenValueDto.builder().tokenAddress("0x0").tokenSymbol("ZRX").totalAmount(new BigDecimal("123.464"...
public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); }
FiatService { public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); } }
FiatService { public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); } FiatService(CryptoCompareService cryptoCompareService, CoinMarketCapService coinMarketCapService); }
FiatService { public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); } FiatService(CryptoCompareService cryptoCompareService, CoinMarketCapService coinMarketCapService); doubl...
FiatService { public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); } FiatService(CryptoCompareService cryptoCompareService, CoinMarketCapService coinMarketCapService); doubl...
@Test public void coinMarketCapHasPriority() { TokenValueDto totalFund = TokenValueDto.builder().tokenAddress("0x0").tokenSymbol("FND").totalAmount(BigDecimal.TEN).build(); when(coinMarketCapService.getCurrentPriceInUsd("FND")).thenReturn(Optional.of(0.56)); double result = fiatService.getUsdPrice(totalFund); assertTha...
public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); }
FiatService { public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); } }
FiatService { public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); } FiatService(CryptoCompareService cryptoCompareService, CoinMarketCapService coinMarketCapService); }
FiatService { public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); } FiatService(CryptoCompareService cryptoCompareService, CoinMarketCapService coinMarketCapService); doubl...
FiatService { public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); } FiatService(CryptoCompareService cryptoCompareService, CoinMarketCapService coinMarketCapService); doubl...
@Test public void cryptoCompareIsFallback() { TokenValueDto totalFund = TokenValueDto.builder().tokenAddress("0x0").tokenSymbol("FND").totalAmount(BigDecimal.TEN).build(); when(coinMarketCapService.getCurrentPriceInUsd("FND")).thenReturn(Optional.empty()); when(cryptoCompareService.getCurrentPriceInUsd("FND")).thenRetu...
public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); }
FiatService { public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); } }
FiatService { public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); } FiatService(CryptoCompareService cryptoCompareService, CoinMarketCapService coinMarketCapService); }
FiatService { public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); } FiatService(CryptoCompareService cryptoCompareService, CoinMarketCapService coinMarketCapService); doubl...
FiatService { public double getUsdPrice(TokenValueDto... funds) { return Arrays.stream(funds) .filter(f -> f != null && StringUtils.isNotBlank(f.getTokenSymbol())) .map(this::getValue) .mapToDouble(f -> f) .sum(); } FiatService(CryptoCompareService cryptoCompareService, CoinMarketCapService coinMarketCapService); doubl...
@Test void getListings() { CmcListingsResult listings = client.getListings(); assertThat(listings).isNotNull(); }
@Override public CmcListingsResult getListings() { return restTemplate.getForObject(endpoint + "/v1/cryptocurrency/listings/latest?limit=5000", CmcListingsResult.class); }
CoinMarketCapClientImpl implements CoinMarketCapClient { @Override public CmcListingsResult getListings() { return restTemplate.getForObject(endpoint + "/v1/cryptocurrency/listings/latest?limit=5000", CmcListingsResult.class); } }
CoinMarketCapClientImpl implements CoinMarketCapClient { @Override public CmcListingsResult getListings() { return restTemplate.getForObject(endpoint + "/v1/cryptocurrency/listings/latest?limit=5000", CmcListingsResult.class); } CoinMarketCapClientImpl(@Value("${coinmarketcap.apikey}") String apiKey); }
CoinMarketCapClientImpl implements CoinMarketCapClient { @Override public CmcListingsResult getListings() { return restTemplate.getForObject(endpoint + "/v1/cryptocurrency/listings/latest?limit=5000", CmcListingsResult.class); } CoinMarketCapClientImpl(@Value("${coinmarketcap.apikey}") String apiKey); @Override CmcList...
CoinMarketCapClientImpl implements CoinMarketCapClient { @Override public CmcListingsResult getListings() { return restTemplate.getForObject(endpoint + "/v1/cryptocurrency/listings/latest?limit=5000", CmcListingsResult.class); } CoinMarketCapClientImpl(@Value("${coinmarketcap.apikey}") String apiKey); @Override CmcList...
@Test void handle() { long fundId = 243L; long requestId = 764L; final String message = "ewfegdbf"; final RequestFundedNotificationDto notification = RequestFundedNotificationDto.builder().fundId(fundId).requestId(requestId).build(); final TokenValueDto tokenValue = TokenValueDtoMother.FND().build(); final FundDto fund...
@EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { final FundDto fund = fundService.findOne(notification.getFundId()); Context context = new Context(); context.setVariable("platformBasePath", platformBas...
RequestFundedGitterHandler { @EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { final FundDto fund = fundService.findOne(notification.getFundId()); Context context = new Context(); context.setVariable("p...
RequestFundedGitterHandler { @EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { final FundDto fund = fundService.findOne(notification.getFundId()); Context context = new Context(); context.setVariable("p...
RequestFundedGitterHandler { @EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { final FundDto fund = fundService.findOne(notification.getFundId()); Context context = new Context(); context.setVariable("p...
RequestFundedGitterHandler { @EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { final FundDto fund = fundService.findOne(notification.getFundId()); Context context = new Context(); context.setVariable("p...
@Test void getPrice() { PriceResultDto result = client.getPrice("DAI"); System.out.println(result); }
public PriceResultDto getPrice(String symbol) { return restTemplate.getForObject(endpoint + "/data/price?fsym={symbol}&tsyms=USD", PriceResultDto.class, symbol); }
CryptoCompareClientImpl implements CryptoCompareClient { public PriceResultDto getPrice(String symbol) { return restTemplate.getForObject(endpoint + "/data/price?fsym={symbol}&tsyms=USD", PriceResultDto.class, symbol); } }
CryptoCompareClientImpl implements CryptoCompareClient { public PriceResultDto getPrice(String symbol) { return restTemplate.getForObject(endpoint + "/data/price?fsym={symbol}&tsyms=USD", PriceResultDto.class, symbol); } CryptoCompareClientImpl(@Value("${cryptocompare.apikey}") String apiKey); }
CryptoCompareClientImpl implements CryptoCompareClient { public PriceResultDto getPrice(String symbol) { return restTemplate.getForObject(endpoint + "/data/price?fsym={symbol}&tsyms=USD", PriceResultDto.class, symbol); } CryptoCompareClientImpl(@Value("${cryptocompare.apikey}") String apiKey); PriceResultDto getPrice(S...
CryptoCompareClientImpl implements CryptoCompareClient { public PriceResultDto getPrice(String symbol) { return restTemplate.getForObject(endpoint + "/data/price?fsym={symbol}&tsyms=USD", PriceResultDto.class, symbol); } CryptoCompareClientImpl(@Value("${cryptocompare.apikey}") String apiKey); PriceResultDto getPrice(S...
@Test public void findAll() { List<Request> requests = singletonList(RequestMother.freeCodeCampNoUserStories().build()); when(requestRepository.findAll()).thenReturn(requests); List<RequestDto> expectedRequests = singletonList(RequestDtoMother.freeCodeCampNoUserStories()); when(mappers.mapList(Request.class, RequestDto...
@Override @Transactional(readOnly = true) public List<RequestDto> findAll() { return mappers.mapList(Request.class, RequestDto.class, requestRepository.findAll()); }
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public List<RequestDto> findAll() { return mappers.mapList(Request.class, RequestDto.class, requestRepository.findAll()); } }
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public List<RequestDto> findAll() { return mappers.mapList(Request.class, RequestDto.class, requestRepository.findAll()); } RequestServiceImpl(final RequestRepository requestRepository, final Mappers m...
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public List<RequestDto> findAll() { return mappers.mapList(Request.class, RequestDto.class, requestRepository.findAll()); } RequestServiceImpl(final RequestRepository requestRepository, final Mappers m...
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public List<RequestDto> findAll() { return mappers.mapList(Request.class, RequestDto.class, requestRepository.findAll()); } RequestServiceImpl(final RequestRepository requestRepository, final Mappers m...
@Test public void findAllFor() { final List<String> projects = new ArrayList<>(); final List<String> technologies = new ArrayList<>(); final long lastUpdatedSinceDays = 10L; final List<Request> requests = new ArrayList<>(); final List<RequestDto> expected = new ArrayList<>(); when(requestRepository.findAll(refEq(new Re...
@Transactional(readOnly = true) public List<RequestDto> findAllFor(final List<String> projects, final List<String> technologies, final Long lastUpdatedSinceDays) { final RequestSpecification specification = new RequestSpecification(projects, technologies, lastUpdatedSinceDays); return mappers.mapList(Request.class, Req...
RequestServiceImpl implements RequestService { @Transactional(readOnly = true) public List<RequestDto> findAllFor(final List<String> projects, final List<String> technologies, final Long lastUpdatedSinceDays) { final RequestSpecification specification = new RequestSpecification(projects, technologies, lastUpdatedSinceD...
RequestServiceImpl implements RequestService { @Transactional(readOnly = true) public List<RequestDto> findAllFor(final List<String> projects, final List<String> technologies, final Long lastUpdatedSinceDays) { final RequestSpecification specification = new RequestSpecification(projects, technologies, lastUpdatedSinceD...
RequestServiceImpl implements RequestService { @Transactional(readOnly = true) public List<RequestDto> findAllFor(final List<String> projects, final List<String> technologies, final Long lastUpdatedSinceDays) { final RequestSpecification specification = new RequestSpecification(projects, technologies, lastUpdatedSinceD...
RequestServiceImpl implements RequestService { @Transactional(readOnly = true) public List<RequestDto> findAllFor(final List<String> projects, final List<String> technologies, final Long lastUpdatedSinceDays) { final RequestSpecification specification = new RequestSpecification(projects, technologies, lastUpdatedSinceD...
@Test public void generateERC67() { when(environment.getProperty("io.fundrequest.payments.erc67.gas", "200000")) .thenReturn("150000"); final CreateERC67FundRequest erc67 = CreateERC67FundRequest .builder() .amount(new BigDecimal("100.384739")) .tokenAddress("0x0000000000000000000000000000000000000000") .platform("gith...
@Override public String generateERC67(final CreateERC67FundRequest createERC67FundRequest) { return new ERC67.Builder() .withAddress(createERC67FundRequest.getTokenAddress()) .withNetwork("ethereum") .withParameter("value", "0") .withParameter("gas", environment.getProperty("io.fundrequest.payments.erc67.gas", "200000"...
RequestServiceImpl implements RequestService { @Override public String generateERC67(final CreateERC67FundRequest createERC67FundRequest) { return new ERC67.Builder() .withAddress(createERC67FundRequest.getTokenAddress()) .withNetwork("ethereum") .withParameter("value", "0") .withParameter("gas", environment.getPropert...
RequestServiceImpl implements RequestService { @Override public String generateERC67(final CreateERC67FundRequest createERC67FundRequest) { return new ERC67.Builder() .withAddress(createERC67FundRequest.getTokenAddress()) .withNetwork("ethereum") .withParameter("value", "0") .withParameter("gas", environment.getPropert...
RequestServiceImpl implements RequestService { @Override public String generateERC67(final CreateERC67FundRequest createERC67FundRequest) { return new ERC67.Builder() .withAddress(createERC67FundRequest.getTokenAddress()) .withNetwork("ethereum") .withParameter("value", "0") .withParameter("gas", environment.getPropert...
RequestServiceImpl implements RequestService { @Override public String generateERC67(final CreateERC67FundRequest createERC67FundRequest) { return new ERC67.Builder() .withAddress(createERC67FundRequest.getTokenAddress()) .withNetwork("ethereum") .withParameter("value", "0") .withParameter("gas", environment.getPropert...
@Test public void findAllByIterable() { List<Request> requests = singletonList(RequestMother.freeCodeCampNoUserStories().build()); Set<Long> ids = requests.stream().map(Request::getId).collect(Collectors.toSet()); when(requestRepository.findAll(ids)).thenReturn(requests); List<RequestDto> expectedRequests = singletonLi...
@Override @Transactional(readOnly = true) public List<RequestDto> findAll() { return mappers.mapList(Request.class, RequestDto.class, requestRepository.findAll()); }
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public List<RequestDto> findAll() { return mappers.mapList(Request.class, RequestDto.class, requestRepository.findAll()); } }
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public List<RequestDto> findAll() { return mappers.mapList(Request.class, RequestDto.class, requestRepository.findAll()); } RequestServiceImpl(final RequestRepository requestRepository, final Mappers m...
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public List<RequestDto> findAll() { return mappers.mapList(Request.class, RequestDto.class, requestRepository.findAll()); } RequestServiceImpl(final RequestRepository requestRepository, final Mappers m...
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public List<RequestDto> findAll() { return mappers.mapList(Request.class, RequestDto.class, requestRepository.findAll()); } RequestServiceImpl(final RequestRepository requestRepository, final Mappers m...
@Test public void findRequest() { Optional<Request> request = Optional.of(RequestMother.freeCodeCampNoUserStories().withWatchers(singletonList("davy")).withId(1L).build()); when(requestRepository.findOne(request.get().getId())).thenReturn(request); RequestDto expectedRequest = RequestDtoMother.freeCodeCampNoUserStories...
@Override @Transactional(readOnly = true) public RequestDto findRequest(Long id) { Request request = findOne(id); return mappers.map(Request.class, RequestDto.class, request); }
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public RequestDto findRequest(Long id) { Request request = findOne(id); return mappers.map(Request.class, RequestDto.class, request); } }
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public RequestDto findRequest(Long id) { Request request = findOne(id); return mappers.map(Request.class, RequestDto.class, request); } RequestServiceImpl(final RequestRepository requestRepository, fin...
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public RequestDto findRequest(Long id) { Request request = findOne(id); return mappers.map(Request.class, RequestDto.class, request); } RequestServiceImpl(final RequestRepository requestRepository, fin...
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public RequestDto findRequest(Long id) { Request request = findOne(id); return mappers.map(Request.class, RequestDto.class, request); } RequestServiceImpl(final RequestRepository requestRepository, fin...
@Test public void findRequestsForUser() { Principal user = mock(Principal.class, RETURNS_DEEP_STUBS); List<Request> requests = singletonList(RequestMother.freeCodeCampNoUserStories().build()); when(requestRepository.findRequestsUserIsWatching(user.getName())).thenReturn(requests); List<String> addresses = Collections.s...
@Override @Transactional(readOnly = true) public List<RequestDto> findRequestsForUser(Principal principal) { Set<Request> result = new HashSet<>(); List<String> etherAddresses = profileService.getUserProfile(principal).getEtherAddresses(); result.addAll(requestRepository.findRequestsUserIsWatching(principal.getName()))...
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public List<RequestDto> findRequestsForUser(Principal principal) { Set<Request> result = new HashSet<>(); List<String> etherAddresses = profileService.getUserProfile(principal).getEtherAddresses(); result.addAll(requestRepository.f...
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public List<RequestDto> findRequestsForUser(Principal principal) { Set<Request> result = new HashSet<>(); List<String> etherAddresses = profileService.getUserProfile(principal).getEtherAddresses(); result.addAll(requestRepository.f...
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public List<RequestDto> findRequestsForUser(Principal principal) { Set<Request> result = new HashSet<>(); List<String> etherAddresses = profileService.getUserProfile(principal).getEtherAddresses(); result.addAll(requestRepository.f...
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public List<RequestDto> findRequestsForUser(Principal principal) { Set<Request> result = new HashSet<>(); List<String> etherAddresses = profileService.getUserProfile(principal).getEtherAddresses(); result.addAll(requestRepository.f...
@Test public void createWithNewIssue() { CreateRequestCommand command = createCommand(); when(requestRepository.findByPlatformAndPlatformId(command.getPlatform(), command.getPlatformId())).thenReturn(Optional.empty()); IssueInformation issueInformation = IssueInformationMother.kazuki43zooApiStub().build(); when(githubL...
@Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") public Long createRequest(CreateRequestCommand command) { Optional<Request> request = requestRepository.findByPlatformAndPlatformId(command.getPlatform(), command.getPlatformId()); Request r = request.orElseGet(() -> createNewRequ...
RequestServiceImpl implements RequestService { @Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") public Long createRequest(CreateRequestCommand command) { Optional<Request> request = requestRepository.findByPlatformAndPlatformId(command.getPlatform(), command.getPlatformId()); Re...
RequestServiceImpl implements RequestService { @Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") public Long createRequest(CreateRequestCommand command) { Optional<Request> request = requestRepository.findByPlatformAndPlatformId(command.getPlatform(), command.getPlatformId()); Re...
RequestServiceImpl implements RequestService { @Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") public Long createRequest(CreateRequestCommand command) { Optional<Request> request = requestRepository.findByPlatformAndPlatformId(command.getPlatform(), command.getPlatformId()); Re...
RequestServiceImpl implements RequestService { @Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") public Long createRequest(CreateRequestCommand command) { Optional<Request> request = requestRepository.findByPlatformAndPlatformId(command.getPlatform(), command.getPlatformId()); Re...
@Test public void createWithExistingIssue() { CreateRequestCommand command = createCommand(); Optional<Request> request = Optional.of(RequestMother.freeCodeCampNoUserStories().build()); when(requestRepository.findByPlatformAndPlatformId(command.getPlatform(), command.getPlatformId())).thenReturn(request); IssueInformat...
@Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") public Long createRequest(CreateRequestCommand command) { Optional<Request> request = requestRepository.findByPlatformAndPlatformId(command.getPlatform(), command.getPlatformId()); Request r = request.orElseGet(() -> createNewRequ...
RequestServiceImpl implements RequestService { @Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") public Long createRequest(CreateRequestCommand command) { Optional<Request> request = requestRepository.findByPlatformAndPlatformId(command.getPlatform(), command.getPlatformId()); Re...
RequestServiceImpl implements RequestService { @Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") public Long createRequest(CreateRequestCommand command) { Optional<Request> request = requestRepository.findByPlatformAndPlatformId(command.getPlatform(), command.getPlatformId()); Re...
RequestServiceImpl implements RequestService { @Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") public Long createRequest(CreateRequestCommand command) { Optional<Request> request = requestRepository.findByPlatformAndPlatformId(command.getPlatform(), command.getPlatformId()); Re...
RequestServiceImpl implements RequestService { @Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") public Long createRequest(CreateRequestCommand command) { Optional<Request> request = requestRepository.findByPlatformAndPlatformId(command.getPlatform(), command.getPlatformId()); Re...
@Test public void signClaimRequest() { final UserClaimRequest command = UserClaimRequest.builder() .platform(Platform.GITHUB) .platformId("1") .build(); final Principal principal = () -> "davyvanroy"; final Request request = RequestMother.freeCodeCampNoUserStories().build(); final RequestDto requestDto = RequestDtoMoth...
@Override @Transactional(readOnly = true) public SignedClaim signClaimRequest(Principal user, UserClaimRequest userClaimRequest) { return githubClaimResolver.getSignedClaim(user, userClaimRequest, findRequest(userClaimRequest.getPlatform(), userClaimRequest.getPlatformId())); }
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public SignedClaim signClaimRequest(Principal user, UserClaimRequest userClaimRequest) { return githubClaimResolver.getSignedClaim(user, userClaimRequest, findRequest(userClaimRequest.getPlatform(), userClaimRequest.getPlatformId()...
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public SignedClaim signClaimRequest(Principal user, UserClaimRequest userClaimRequest) { return githubClaimResolver.getSignedClaim(user, userClaimRequest, findRequest(userClaimRequest.getPlatform(), userClaimRequest.getPlatformId()...
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public SignedClaim signClaimRequest(Principal user, UserClaimRequest userClaimRequest) { return githubClaimResolver.getSignedClaim(user, userClaimRequest, findRequest(userClaimRequest.getPlatform(), userClaimRequest.getPlatformId()...
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public SignedClaim signClaimRequest(Principal user, UserClaimRequest userClaimRequest) { return githubClaimResolver.getSignedClaim(user, userClaimRequest, findRequest(userClaimRequest.getPlatform(), userClaimRequest.getPlatformId()...
@Test void handle_noFundedNotificationChannels() { long fundId = 243L; long requestId = 764L; final String message = "ewfegdbf"; final RequestFundedNotificationDto notification = RequestFundedNotificationDto.builder().fundId(fundId).requestId(requestId).build(); final TokenValueDto tokenValue = TokenValueDtoMother.FND(...
@EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { final FundDto fund = fundService.findOne(notification.getFundId()); Context context = new Context(); context.setVariable("platformBasePath", platformBas...
RequestFundedGitterHandler { @EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { final FundDto fund = fundService.findOne(notification.getFundId()); Context context = new Context(); context.setVariable("p...
RequestFundedGitterHandler { @EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { final FundDto fund = fundService.findOne(notification.getFundId()); Context context = new Context(); context.setVariable("p...
RequestFundedGitterHandler { @EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { final FundDto fund = fundService.findOne(notification.getFundId()); Context context = new Context(); context.setVariable("p...
RequestFundedGitterHandler { @EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestFundedNotificationDto notification) { final FundDto fund = fundService.findOne(notification.getFundId()); Context context = new Context(); context.setVariable("p...
@Test public void requestClaimed() { final RequestClaimedCommand command = new RequestClaimedCommand(); command.setTimestamp(LocalDateTime.now()); command.setSolver("davyvanroy"); command.setPlatform(Platform.GITHUB); command.setPlatformId("1"); command.setBlockchainEventId(6453L); final Request request = RequestMother...
@Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") public Request requestClaimed(RequestClaimedCommand command) { final Request request = updateStatus(requestRepository.findByPlatformAndPlatformId(command.getPlatform(), command.getPlatformId()) .orElseThrow(ResourceNotFoundExcepti...
RequestServiceImpl implements RequestService { @Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") public Request requestClaimed(RequestClaimedCommand command) { final Request request = updateStatus(requestRepository.findByPlatformAndPlatformId(command.getPlatform(), command.getPla...
RequestServiceImpl implements RequestService { @Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") public Request requestClaimed(RequestClaimedCommand command) { final Request request = updateStatus(requestRepository.findByPlatformAndPlatformId(command.getPlatform(), command.getPla...
RequestServiceImpl implements RequestService { @Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") public Request requestClaimed(RequestClaimedCommand command) { final Request request = updateStatus(requestRepository.findByPlatformAndPlatformId(command.getPlatform(), command.getPla...
RequestServiceImpl implements RequestService { @Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") public Request requestClaimed(RequestClaimedCommand command) { final Request request = updateStatus(requestRepository.findByPlatformAndPlatformId(command.getPlatform(), command.getPla...
@Test public void getComments() { Request request = RequestMother.fundRequestArea51().build(); when(requestRepository.findOne(1L)).thenReturn(Optional.of(request)); List<GithubIssueCommentsResult> githubComments = Collections.singletonList(GithubIssueCommentsResult.builder().title("title").body("#body").build()); when(...
@Override @Transactional(readOnly = true) public List<CommentDto> getComments(Long requestId) { Request request = requestRepository.findOne(requestId).orElseThrow(() -> new EntityNotFoundException("Request not found")); return mappers.mapList(GithubIssueCommentsResult.class, CommentDto.class, githubGateway.getCommentsF...
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public List<CommentDto> getComments(Long requestId) { Request request = requestRepository.findOne(requestId).orElseThrow(() -> new EntityNotFoundException("Request not found")); return mappers.mapList(GithubIssueCommentsResult.clas...
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public List<CommentDto> getComments(Long requestId) { Request request = requestRepository.findOne(requestId).orElseThrow(() -> new EntityNotFoundException("Request not found")); return mappers.mapList(GithubIssueCommentsResult.clas...
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public List<CommentDto> getComments(Long requestId) { Request request = requestRepository.findOne(requestId).orElseThrow(() -> new EntityNotFoundException("Request not found")); return mappers.mapList(GithubIssueCommentsResult.clas...
RequestServiceImpl implements RequestService { @Override @Transactional(readOnly = true) public List<CommentDto> getComments(Long requestId) { Request request = requestRepository.findOne(requestId).orElseThrow(() -> new EntityNotFoundException("Request not found")); return mappers.mapList(GithubIssueCommentsResult.clas...
@Test public void update() { final long requestId = 213L; final Request request = RequestMother.fundRequestArea51().withStatus(OPEN).build(); when(requestRepository.findOne(requestId)).thenReturn(Optional.of(request)); requestService.update(new UpdateRequestStatusCommand(requestId, FUNDED)); assertThat(request.getStatu...
@Override public void update(final UpdateRequestStatusCommand command) { requestRepository.findOne(command.getRequestId()).ifPresent(request -> { request.setStatus(command.getNewStatus()); requestRepository.save(request); }); }
RequestServiceImpl implements RequestService { @Override public void update(final UpdateRequestStatusCommand command) { requestRepository.findOne(command.getRequestId()).ifPresent(request -> { request.setStatus(command.getNewStatus()); requestRepository.save(request); }); } }
RequestServiceImpl implements RequestService { @Override public void update(final UpdateRequestStatusCommand command) { requestRepository.findOne(command.getRequestId()).ifPresent(request -> { request.setStatus(command.getNewStatus()); requestRepository.save(request); }); } RequestServiceImpl(final RequestRepository re...
RequestServiceImpl implements RequestService { @Override public void update(final UpdateRequestStatusCommand command) { requestRepository.findOne(command.getRequestId()).ifPresent(request -> { request.setStatus(command.getNewStatus()); requestRepository.save(request); }); } RequestServiceImpl(final RequestRepository re...
RequestServiceImpl implements RequestService { @Override public void update(final UpdateRequestStatusCommand command) { requestRepository.findOne(command.getRequestId()).ifPresent(request -> { request.setStatus(command.getNewStatus()); requestRepository.save(request); }); } RequestServiceImpl(final RequestRepository re...
@Test public void toFunction() { CreateERC67FundRequest erc67FundRequest = CreateERC67FundRequest .builder() .amount(new BigDecimal("100.837483")) .tokenAddress("0x02F96eF85cAd6639500CA1cc8356F0b5CA5bF1D2") .platform("github") .platformId("1") .build(); when(tokenInfoService.getTokenInfo(erc67FundRequest.getTokenAddres...
public String toFunction(CreateERC67FundRequest erc67FundRequest) { TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(erc67FundRequest.getTokenAddress()); final StringBuilder builder = new StringBuilder("approveAndCall").append("("); builder.append("address ").append(fundRequestContractAddress).append(", "); build...
Erc67Generator { public String toFunction(CreateERC67FundRequest erc67FundRequest) { TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(erc67FundRequest.getTokenAddress()); final StringBuilder builder = new StringBuilder("approveAndCall").append("("); builder.append("address ").append(fundRequestContractAddress).ap...
Erc67Generator { public String toFunction(CreateERC67FundRequest erc67FundRequest) { TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(erc67FundRequest.getTokenAddress()); final StringBuilder builder = new StringBuilder("approveAndCall").append("("); builder.append("address ").append(fundRequestContractAddress).ap...
Erc67Generator { public String toFunction(CreateERC67FundRequest erc67FundRequest) { TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(erc67FundRequest.getTokenAddress()); final StringBuilder builder = new StringBuilder("approveAndCall").append("("); builder.append("address ").append(fundRequestContractAddress).ap...
Erc67Generator { public String toFunction(CreateERC67FundRequest erc67FundRequest) { TokenInfoDto tokenInfo = tokenInfoService.getTokenInfo(erc67FundRequest.getTokenAddress()); final StringBuilder builder = new StringBuilder("approveAndCall").append("("); builder.append("address ").append(fundRequestContractAddress).ap...
@Test void handle_updateLastModifiedDate() { final long requestId = 6578L; final RequestFundedEvent event = RequestFundedEvent.builder().requestId(requestId).build(); final Request request = RequestMother.fundRequestArea51() .withLastModifiedDate(LocalDateTime.now().minusWeeks(3)) .build(); when(requestRepository.findO...
@EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); request.setLastModifiedDate(LocalDateTime.now()); requestRepository.saveAndFlush(request); }
UpdateRequestLastModifiedDateOnFundedHandler { @EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); request.setLastModifiedDate(LocalDateTime.now()); requestReposito...
UpdateRequestLastModifiedDateOnFundedHandler { @EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); request.setLastModifiedDate(LocalDateTime.now()); requestReposito...
UpdateRequestLastModifiedDateOnFundedHandler { @EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); request.setLastModifiedDate(LocalDateTime.now()); requestReposito...
UpdateRequestLastModifiedDateOnFundedHandler { @EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); request.setLastModifiedDate(LocalDateTime.now()); requestReposito...
@Test void handle_requestNotFound() { final long requestId = 234; final RequestFundedEvent event = RequestFundedEvent.builder().requestId(requestId).build(); when(requestRepository.findOne(requestId)).thenReturn(Optional.empty()); try { handler.handle(event); fail("Expected new RuntimeException(\"Unable to find request...
@EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); request.setLastModifiedDate(LocalDateTime.now()); requestRepository.saveAndFlush(request); }
UpdateRequestLastModifiedDateOnFundedHandler { @EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); request.setLastModifiedDate(LocalDateTime.now()); requestReposito...
UpdateRequestLastModifiedDateOnFundedHandler { @EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); request.setLastModifiedDate(LocalDateTime.now()); requestReposito...
UpdateRequestLastModifiedDateOnFundedHandler { @EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); request.setLastModifiedDate(LocalDateTime.now()); requestReposito...
UpdateRequestLastModifiedDateOnFundedHandler { @EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); request.setLastModifiedDate(LocalDateTime.now()); requestReposito...
@Test void handle_requestOPEN() { final long requestId = 6578L; final RequestFundedEvent event = RequestFundedEvent.builder().requestId(requestId).build(); final Request request = RequestMother.fundRequestArea51().withStatus(OPEN).build(); when(requestRepository.findOne(requestId)).thenReturn(Optional.of(request)); han...
@EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); if (RequestStatus.OPEN == request.getStatus()) { request.setStatus(RequestStatus.FUNDED); requestRepository.save...
ChangeRequestStatusOnFundedHandler { @EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); if (RequestStatus.OPEN == request.getStatus()) { request.setStatus(RequestS...
ChangeRequestStatusOnFundedHandler { @EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); if (RequestStatus.OPEN == request.getStatus()) { request.setStatus(RequestS...
ChangeRequestStatusOnFundedHandler { @EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); if (RequestStatus.OPEN == request.getStatus()) { request.setStatus(RequestS...
ChangeRequestStatusOnFundedHandler { @EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); if (RequestStatus.OPEN == request.getStatus()) { request.setStatus(RequestS...
@Test void handle_requestNotFound() { final long requestId = 908978; final RequestFundedEvent event = RequestFundedEvent.builder().requestId(requestId).build(); when(requestRepository.findOne(requestId)).thenReturn(Optional.empty()); try { handler.handle(event); fail("Expected new RuntimeException(\"Unable to find requ...
@EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); if (RequestStatus.OPEN == request.getStatus()) { request.setStatus(RequestStatus.FUNDED); requestRepository.save...
ChangeRequestStatusOnFundedHandler { @EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); if (RequestStatus.OPEN == request.getStatus()) { request.setStatus(RequestS...
ChangeRequestStatusOnFundedHandler { @EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); if (RequestStatus.OPEN == request.getStatus()) { request.setStatus(RequestS...
ChangeRequestStatusOnFundedHandler { @EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); if (RequestStatus.OPEN == request.getStatus()) { request.setStatus(RequestS...
ChangeRequestStatusOnFundedHandler { @EventListener public void handle(final RequestFundedEvent event) { final Request request = requestRepository.findOne(event.getRequestId()) .orElseThrow(() -> new RuntimeException("Unable to find request")); if (RequestStatus.OPEN == request.getStatus()) { request.setStatus(RequestS...
@Test public void parseIssueInformation() throws Exception { GithubResult githubResult = GithubResultMother.kazuki43zooApiStub42().build(); String owner = "kazuki43zoo"; String repo = "api-stub"; String number = "42"; when(githubGateway.getIssue(owner, repo, number)) .thenReturn(githubResult); String platformId = owner...
public IssueInformation parseIssue(String platformId) { IssueInformation issueInformation = IssueInformation.builder().build(); String[] splitted = platformId.split(Pattern.quote(PLATFORM_ID_GITHUB_DELIMTER)); issueInformation.setOwner(splitted[0]); issueInformation.setRepo(splitted[1]); issueInformation.setNumber(spli...
GithubPlatformIdParser { public IssueInformation parseIssue(String platformId) { IssueInformation issueInformation = IssueInformation.builder().build(); String[] splitted = platformId.split(Pattern.quote(PLATFORM_ID_GITHUB_DELIMTER)); issueInformation.setOwner(splitted[0]); issueInformation.setRepo(splitted[1]); issueI...
GithubPlatformIdParser { public IssueInformation parseIssue(String platformId) { IssueInformation issueInformation = IssueInformation.builder().build(); String[] splitted = platformId.split(Pattern.quote(PLATFORM_ID_GITHUB_DELIMTER)); issueInformation.setOwner(splitted[0]); issueInformation.setRepo(splitted[1]); issueI...
GithubPlatformIdParser { public IssueInformation parseIssue(String platformId) { IssueInformation issueInformation = IssueInformation.builder().build(); String[] splitted = platformId.split(Pattern.quote(PLATFORM_ID_GITHUB_DELIMTER)); issueInformation.setOwner(splitted[0]); issueInformation.setRepo(splitted[1]); issueI...
GithubPlatformIdParser { public IssueInformation parseIssue(String platformId) { IssueInformation issueInformation = IssueInformation.builder().build(); String[] splitted = platformId.split(Pattern.quote(PLATFORM_ID_GITHUB_DELIMTER)); issueInformation.setOwner(splitted[0]); issueInformation.setRepo(splitted[1]); issueI...
@Test public void extractOwner() { final String owner = "sgsgsg"; final String repo = "utyejy"; final String issueNumber = "6453"; final String result = GithubPlatformIdParser.extractOwner(owner + "|FR|" + repo + "|FR|" + issueNumber); assertThat(result).isEqualTo(owner); }
public static String extractOwner(final String platformId) { return extract(platformId, OWNER_GROUP_NAME); }
GithubPlatformIdParser { public static String extractOwner(final String platformId) { return extract(platformId, OWNER_GROUP_NAME); } }
GithubPlatformIdParser { public static String extractOwner(final String platformId) { return extract(platformId, OWNER_GROUP_NAME); } GithubPlatformIdParser(GithubGateway githubGateway); }
GithubPlatformIdParser { public static String extractOwner(final String platformId) { return extract(platformId, OWNER_GROUP_NAME); } GithubPlatformIdParser(GithubGateway githubGateway); static String extractOwner(final String platformId); static String extractRepo(String platformId); static String extractIssueNumber(f...
GithubPlatformIdParser { public static String extractOwner(final String platformId) { return extract(platformId, OWNER_GROUP_NAME); } GithubPlatformIdParser(GithubGateway githubGateway); static String extractOwner(final String platformId); static String extractRepo(String platformId); static String extractIssueNumber(f...
@Test void handle() { final long blockchainEventId = 2435L; final long requestId = 54657L; final long claimId = 7657L; final String solver = "afsg"; final String userEmail = "gsfd@afsgb.com"; final UserRepresentation userRepresentation = new UserRepresentation(); userRepresentation.setEmail(userEmail); final RequestCla...
@EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestClaimedNotificationDto notification) { claimService.findOne(notification.getClaimId()) .ifPresent(claim -> { final RequestDto request = requestService.findRequest(notification.getRequestId()...
RequestClaimedUserNotificationHandler { @EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestClaimedNotificationDto notification) { claimService.findOne(notification.getClaimId()) .ifPresent(claim -> { final RequestDto request = requestService...
RequestClaimedUserNotificationHandler { @EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestClaimedNotificationDto notification) { claimService.findOne(notification.getClaimId()) .ifPresent(claim -> { final RequestDto request = requestService...
RequestClaimedUserNotificationHandler { @EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestClaimedNotificationDto notification) { claimService.findOne(notification.getClaimId()) .ifPresent(claim -> { final RequestDto request = requestService...
RequestClaimedUserNotificationHandler { @EventListener @Async("taskExecutor") @Transactional(readOnly = true, propagation = REQUIRES_NEW) public void handle(final RequestClaimedNotificationDto notification) { claimService.findOne(notification.getClaimId()) .ifPresent(claim -> { final RequestDto request = requestService...
@Test public void extractOwner_invalidPlatformId() { final String platformId = "sgsgsg|FR|utyejy"; assertThatIllegalArgumentException().isThrownBy(() -> GithubPlatformIdParser.extractOwner(platformId)) .withMessage("platformId '" + platformId + "' has an invalid format, <owner> could not be extracted"); }
public static String extractOwner(final String platformId) { return extract(platformId, OWNER_GROUP_NAME); }
GithubPlatformIdParser { public static String extractOwner(final String platformId) { return extract(platformId, OWNER_GROUP_NAME); } }
GithubPlatformIdParser { public static String extractOwner(final String platformId) { return extract(platformId, OWNER_GROUP_NAME); } GithubPlatformIdParser(GithubGateway githubGateway); }
GithubPlatformIdParser { public static String extractOwner(final String platformId) { return extract(platformId, OWNER_GROUP_NAME); } GithubPlatformIdParser(GithubGateway githubGateway); static String extractOwner(final String platformId); static String extractRepo(String platformId); static String extractIssueNumber(f...
GithubPlatformIdParser { public static String extractOwner(final String platformId) { return extract(platformId, OWNER_GROUP_NAME); } GithubPlatformIdParser(GithubGateway githubGateway); static String extractOwner(final String platformId); static String extractRepo(String platformId); static String extractIssueNumber(f...
@Test public void extractRepo() { final String owner = "sgsgsg"; final String repo = "utyejy"; final String issueNumber = "6453"; final String result = GithubPlatformIdParser.extractRepo(owner + "|FR|" + repo + "|FR|" + issueNumber); assertThat(result).isEqualTo(repo); }
public static String extractRepo(String platformId) { return extract(platformId, REPO_GROUP_NAME); }
GithubPlatformIdParser { public static String extractRepo(String platformId) { return extract(platformId, REPO_GROUP_NAME); } }
GithubPlatformIdParser { public static String extractRepo(String platformId) { return extract(platformId, REPO_GROUP_NAME); } GithubPlatformIdParser(GithubGateway githubGateway); }
GithubPlatformIdParser { public static String extractRepo(String platformId) { return extract(platformId, REPO_GROUP_NAME); } GithubPlatformIdParser(GithubGateway githubGateway); static String extractOwner(final String platformId); static String extractRepo(String platformId); static String extractIssueNumber(final Str...
GithubPlatformIdParser { public static String extractRepo(String platformId) { return extract(platformId, REPO_GROUP_NAME); } GithubPlatformIdParser(GithubGateway githubGateway); static String extractOwner(final String platformId); static String extractRepo(String platformId); static String extractIssueNumber(final Str...
@Test public void extractRepo_invalidPlatformId() { final String platformId = "sgsgsg|FR|utyejy"; assertThatIllegalArgumentException().isThrownBy(() -> GithubPlatformIdParser.extractRepo(platformId)) .withMessage("platformId '" + platformId + "' has an invalid format, <repo> could not be extracted"); }
public static String extractRepo(String platformId) { return extract(platformId, REPO_GROUP_NAME); }
GithubPlatformIdParser { public static String extractRepo(String platformId) { return extract(platformId, REPO_GROUP_NAME); } }
GithubPlatformIdParser { public static String extractRepo(String platformId) { return extract(platformId, REPO_GROUP_NAME); } GithubPlatformIdParser(GithubGateway githubGateway); }
GithubPlatformIdParser { public static String extractRepo(String platformId) { return extract(platformId, REPO_GROUP_NAME); } GithubPlatformIdParser(GithubGateway githubGateway); static String extractOwner(final String platformId); static String extractRepo(String platformId); static String extractIssueNumber(final Str...
GithubPlatformIdParser { public static String extractRepo(String platformId) { return extract(platformId, REPO_GROUP_NAME); } GithubPlatformIdParser(GithubGateway githubGateway); static String extractOwner(final String platformId); static String extractRepo(String platformId); static String extractIssueNumber(final Str...
@Test public void extractIssueNumber() { final String owner = "sgsgsg"; final String repo = "utyejy"; final String issueNumber = "6453"; final String result = GithubPlatformIdParser.extractIssueNumber(owner + "|FR|" + repo + "|FR|" + issueNumber); assertThat(result).isEqualTo(issueNumber); }
public static String extractIssueNumber(final String platformId) { return extract(platformId, ISSUE_NUMBER_GROUP_NAME); }
GithubPlatformIdParser { public static String extractIssueNumber(final String platformId) { return extract(platformId, ISSUE_NUMBER_GROUP_NAME); } }
GithubPlatformIdParser { public static String extractIssueNumber(final String platformId) { return extract(platformId, ISSUE_NUMBER_GROUP_NAME); } GithubPlatformIdParser(GithubGateway githubGateway); }
GithubPlatformIdParser { public static String extractIssueNumber(final String platformId) { return extract(platformId, ISSUE_NUMBER_GROUP_NAME); } GithubPlatformIdParser(GithubGateway githubGateway); static String extractOwner(final String platformId); static String extractRepo(String platformId); static String extract...
GithubPlatformIdParser { public static String extractIssueNumber(final String platformId) { return extract(platformId, ISSUE_NUMBER_GROUP_NAME); } GithubPlatformIdParser(GithubGateway githubGateway); static String extractOwner(final String platformId); static String extractRepo(String platformId); static String extract...
@Test public void extractIssueNumber_invalidPlatformId() { final String platformId = "sgsgsg|FR|utyejy"; assertThatIllegalArgumentException().isThrownBy(() -> GithubPlatformIdParser.extractIssueNumber(platformId)) .withMessage("platformId '" + platformId + "' has an invalid format, <issueNumber> could not be extracted"...
public static String extractIssueNumber(final String platformId) { return extract(platformId, ISSUE_NUMBER_GROUP_NAME); }
GithubPlatformIdParser { public static String extractIssueNumber(final String platformId) { return extract(platformId, ISSUE_NUMBER_GROUP_NAME); } }
GithubPlatformIdParser { public static String extractIssueNumber(final String platformId) { return extract(platformId, ISSUE_NUMBER_GROUP_NAME); } GithubPlatformIdParser(GithubGateway githubGateway); }
GithubPlatformIdParser { public static String extractIssueNumber(final String platformId) { return extract(platformId, ISSUE_NUMBER_GROUP_NAME); } GithubPlatformIdParser(GithubGateway githubGateway); static String extractOwner(final String platformId); static String extractRepo(String platformId); static String extract...
GithubPlatformIdParser { public static String extractIssueNumber(final String platformId) { return extract(platformId, ISSUE_NUMBER_GROUP_NAME); } GithubPlatformIdParser(GithubGateway githubGateway); static String extractOwner(final String platformId); static String extractRepo(String platformId); static String extract...
@Test void findOne() { final long blockcheinEventId = 7546L; final BlockchainEvent blockchainEvent = mock(BlockchainEvent.class); final BlockchainEventDto blockchainEventDto = mock(BlockchainEventDto.class); when(blockchainEventRepo.findOne(blockcheinEventId)).thenReturn(Optional.of(blockchainEvent)); when(mapper.mapTo...
@Override public Optional<BlockchainEventDto> findOne(final Long id) { return mapper.mapToOptional(blockchainEventRepo.findOne(id).orElse(null)); }
BlockchainEventServiceImpl implements BlockchainEventService { @Override public Optional<BlockchainEventDto> findOne(final Long id) { return mapper.mapToOptional(blockchainEventRepo.findOne(id).orElse(null)); } }
BlockchainEventServiceImpl implements BlockchainEventService { @Override public Optional<BlockchainEventDto> findOne(final Long id) { return mapper.mapToOptional(blockchainEventRepo.findOne(id).orElse(null)); } BlockchainEventServiceImpl(final BlockchainEventRepository blockchainEventRepo, final BlockchainEventDtoMappe...
BlockchainEventServiceImpl implements BlockchainEventService { @Override public Optional<BlockchainEventDto> findOne(final Long id) { return mapper.mapToOptional(blockchainEventRepo.findOne(id).orElse(null)); } BlockchainEventServiceImpl(final BlockchainEventRepository blockchainEventRepo, final BlockchainEventDtoMappe...
BlockchainEventServiceImpl implements BlockchainEventService { @Override public Optional<BlockchainEventDto> findOne(final Long id) { return mapper.mapToOptional(blockchainEventRepo.findOne(id).orElse(null)); } BlockchainEventServiceImpl(final BlockchainEventRepository blockchainEventRepo, final BlockchainEventDtoMappe...
@Test void findOne_notFound() { final long blockcheinEventId = 7546L; when(blockchainEventRepo.findOne(blockcheinEventId)).thenReturn(Optional.empty()); when(mapper.mapToOptional(null)).thenReturn(Optional.empty()); final Optional<BlockchainEventDto> result = service.findOne(blockcheinEventId); assertThat(result).isEmp...
@Override public Optional<BlockchainEventDto> findOne(final Long id) { return mapper.mapToOptional(blockchainEventRepo.findOne(id).orElse(null)); }
BlockchainEventServiceImpl implements BlockchainEventService { @Override public Optional<BlockchainEventDto> findOne(final Long id) { return mapper.mapToOptional(blockchainEventRepo.findOne(id).orElse(null)); } }
BlockchainEventServiceImpl implements BlockchainEventService { @Override public Optional<BlockchainEventDto> findOne(final Long id) { return mapper.mapToOptional(blockchainEventRepo.findOne(id).orElse(null)); } BlockchainEventServiceImpl(final BlockchainEventRepository blockchainEventRepo, final BlockchainEventDtoMappe...
BlockchainEventServiceImpl implements BlockchainEventService { @Override public Optional<BlockchainEventDto> findOne(final Long id) { return mapper.mapToOptional(blockchainEventRepo.findOne(id).orElse(null)); } BlockchainEventServiceImpl(final BlockchainEventRepository blockchainEventRepo, final BlockchainEventDtoMappe...
BlockchainEventServiceImpl implements BlockchainEventService { @Override public Optional<BlockchainEventDto> findOne(final Long id) { return mapper.mapToOptional(blockchainEventRepo.findOne(id).orElse(null)); } BlockchainEventServiceImpl(final BlockchainEventRepository blockchainEventRepo, final BlockchainEventDtoMappe...
@Test public void getTechnologies() { Set<RequestTechnology> technologies = new HashSet<>(); technologies.add(RequestTechnology.builder().technology("python").weight(2L).build()); technologies.add(RequestTechnology.builder().technology("kotlin").weight(3L).build()); technologies.add(RequestTechnology.builder().technolo...
public Set<String> getTechnologies() { return this.technologies != null && !this.technologies.isEmpty() ? this.technologies.stream() .map(RequestTechnology::getTechnology) .collect(Collectors.toSet()) : new HashSet<>(); }
Request extends AbstractEntity { public Set<String> getTechnologies() { return this.technologies != null && !this.technologies.isEmpty() ? this.technologies.stream() .map(RequestTechnology::getTechnology) .collect(Collectors.toSet()) : new HashSet<>(); } }
Request extends AbstractEntity { public Set<String> getTechnologies() { return this.technologies != null && !this.technologies.isEmpty() ? this.technologies.stream() .map(RequestTechnology::getTechnology) .collect(Collectors.toSet()) : new HashSet<>(); } protected Request(); }
Request extends AbstractEntity { public Set<String> getTechnologies() { return this.technologies != null && !this.technologies.isEmpty() ? this.technologies.stream() .map(RequestTechnology::getTechnology) .collect(Collectors.toSet()) : new HashSet<>(); } protected Request(); void setStatus(RequestStatus status); Long ...
Request extends AbstractEntity { public Set<String> getTechnologies() { return this.technologies != null && !this.technologies.isEmpty() ? this.technologies.stream() .map(RequestTechnology::getTechnology) .collect(Collectors.toSet()) : new HashSet<>(); } protected Request(); void setStatus(RequestStatus status); Long ...
@Test public void setLastModifiedDate() { final LocalDateTime expectedLastModifiedDate = LocalDateTime.now().minusDays(3); final Request request = RequestMother.fundRequestArea51().build(); request.setLastModifiedDate(expectedLastModifiedDate); assertThat(request.getLastModifiedDate()).isEqualTo(expectedLastModifiedDat...
@Override public void setLastModifiedDate(final LocalDateTime lastModifiedDate) { super.setLastModifiedDate(lastModifiedDate); }
Request extends AbstractEntity { @Override public void setLastModifiedDate(final LocalDateTime lastModifiedDate) { super.setLastModifiedDate(lastModifiedDate); } }
Request extends AbstractEntity { @Override public void setLastModifiedDate(final LocalDateTime lastModifiedDate) { super.setLastModifiedDate(lastModifiedDate); } protected Request(); }
Request extends AbstractEntity { @Override public void setLastModifiedDate(final LocalDateTime lastModifiedDate) { super.setLastModifiedDate(lastModifiedDate); } protected Request(); void setStatus(RequestStatus status); Long getId(); RequestStatus getStatus(); RequestType getType(); IssueInformation getIssueInformati...
Request extends AbstractEntity { @Override public void setLastModifiedDate(final LocalDateTime lastModifiedDate) { super.setLastModifiedDate(lastModifiedDate); } protected Request(); void setStatus(RequestStatus status); Long getId(); RequestStatus getStatus(); RequestType getType(); IssueInformation getIssueInformati...
@Test public void save() { TokenInfoDto token = TokenInfoDtoMother.fnd(); PendingFundCommand command = PendingFundCommand.builder() .amount("1.2") .description("description") .fromAddress("0x0") .tokenAddress(token.getAddress()) .platform(Platform.GITHUB) .platformId("FundRequest|FR|area51|FR|12") .transactionId("0x3")...
@Transactional public void save(final Principal principal, final PendingFundCommand command) { final IssueInformation issueInformation = githubLinkParser.parseIssue(command.getPlatformId()); final PendingFund pf = PendingFund.builder() .amount(toWei(command)) .description(command.getDescription()) .fromAddress(command....
PendingFundService { @Transactional public void save(final Principal principal, final PendingFundCommand command) { final IssueInformation issueInformation = githubLinkParser.parseIssue(command.getPlatformId()); final PendingFund pf = PendingFund.builder() .amount(toWei(command)) .description(command.getDescription()) ...
PendingFundService { @Transactional public void save(final Principal principal, final PendingFundCommand command) { final IssueInformation issueInformation = githubLinkParser.parseIssue(command.getPlatformId()); final PendingFund pf = PendingFund.builder() .amount(toWei(command)) .description(command.getDescription()) ...
PendingFundService { @Transactional public void save(final Principal principal, final PendingFundCommand command) { final IssueInformation issueInformation = githubLinkParser.parseIssue(command.getPlatformId()); final PendingFund pf = PendingFund.builder() .amount(toWei(command)) .description(command.getDescription()) ...
PendingFundService { @Transactional public void save(final Principal principal, final PendingFundCommand command) { final IssueInformation issueInformation = githubLinkParser.parseIssue(command.getPlatformId()); final PendingFund pf = PendingFund.builder() .amount(toWei(command)) .description(command.getDescription()) ...
@Test public void showAllMessagesPage() throws Exception { MessageDto messageDto1 = mock(MessageDto.class); MessageDto messageDto2 = mock(MessageDto.class); MessageDto messageDto3 = mock(MessageDto.class); List<MessageDto> messages = Arrays.asList(messageDto1, messageDto2, messageDto3); when(messageService.getMessagesB...
@RequestMapping("/messages") public ModelAndView showAllMessagesPage(final Model model) { model.addAttribute("referralMessages", messageService.getMessagesByType(MessageType.REFERRAL_SHARE)); return new ModelAndView("messages/index"); }
MessagesController extends AbstractController { @RequestMapping("/messages") public ModelAndView showAllMessagesPage(final Model model) { model.addAttribute("referralMessages", messageService.getMessagesByType(MessageType.REFERRAL_SHARE)); return new ModelAndView("messages/index"); } }
MessagesController extends AbstractController { @RequestMapping("/messages") public ModelAndView showAllMessagesPage(final Model model) { model.addAttribute("referralMessages", messageService.getMessagesByType(MessageType.REFERRAL_SHARE)); return new ModelAndView("messages/index"); } MessagesController(final MessageSer...
MessagesController extends AbstractController { @RequestMapping("/messages") public ModelAndView showAllMessagesPage(final Model model) { model.addAttribute("referralMessages", messageService.getMessagesByType(MessageType.REFERRAL_SHARE)); return new ModelAndView("messages/index"); } MessagesController(final MessageSer...
MessagesController extends AbstractController { @RequestMapping("/messages") public ModelAndView showAllMessagesPage(final Model model) { model.addAttribute("referralMessages", messageService.getMessagesByType(MessageType.REFERRAL_SHARE)); return new ModelAndView("messages/index"); } MessagesController(final MessageSer...
@Test public void aggregate() { final String funder1UserId = "dgfhj"; final String funder1Address = "0xFHDsad"; final String funder2UserId = "jghf"; final String funder2Address = "0xtrdkl"; final String funder3UserId = "hfg"; final String funder3Address = "0xeytru"; final FundsByFunderDto fundsByFunderDto1 = buildFunds...
public List<UserFundsDto> aggregate(final List<FundsByFunderDto> fundsByFunder) { return fundsByFunder.stream() .collect(Collectors.groupingBy(funds -> funds.getFunderAddress().toLowerCase() + funds.getFunderUserId(), Collectors.mapping(mapToUserFundDto(), Collectors.reducing(mergeFundsAndRefunds())))) .values() .strea...
FundsAndRefundsAggregator { public List<UserFundsDto> aggregate(final List<FundsByFunderDto> fundsByFunder) { return fundsByFunder.stream() .collect(Collectors.groupingBy(funds -> funds.getFunderAddress().toLowerCase() + funds.getFunderUserId(), Collectors.mapping(mapToUserFundDto(), Collectors.reducing(mergeFundsAndRe...
FundsAndRefundsAggregator { public List<UserFundsDto> aggregate(final List<FundsByFunderDto> fundsByFunder) { return fundsByFunder.stream() .collect(Collectors.groupingBy(funds -> funds.getFunderAddress().toLowerCase() + funds.getFunderUserId(), Collectors.mapping(mapToUserFundDto(), Collectors.reducing(mergeFundsAndRe...
FundsAndRefundsAggregator { public List<UserFundsDto> aggregate(final List<FundsByFunderDto> fundsByFunder) { return fundsByFunder.stream() .collect(Collectors.groupingBy(funds -> funds.getFunderAddress().toLowerCase() + funds.getFunderUserId(), Collectors.mapping(mapToUserFundDto(), Collectors.reducing(mergeFundsAndRe...
FundsAndRefundsAggregator { public List<UserFundsDto> aggregate(final List<FundsByFunderDto> fundsByFunder) { return fundsByFunder.stream() .collect(Collectors.groupingBy(funds -> funds.getFunderAddress().toLowerCase() + funds.getFunderUserId(), Collectors.mapping(mapToUserFundDto(), Collectors.reducing(mergeFundsAndRe...
@Test public void maps() { final String login = "davyvanroy"; final String userUrl = "fxghcgjv"; final String userAvatarUrl = "fgjhkj"; when(delegate.map(any())).thenReturn(CommentDto.builder().build()); final CommentDto result = decorator.map(GithubIssueCommentsResult.builder() .user(GithubUser.builder() .login(login)...
@Override public CommentDto map(GithubIssueCommentsResult in) { CommentDto comment = delegate.map(in); if (comment != null) { comment.setUserName(in.getUser().getLogin()); comment.setUserUrl(in.getUser().getUrl()); comment.setUserAvatar(in.getUser().getAvatarUrl()); } return comment; }
CommentDtoMapperDecorator implements CommentDtoMapper { @Override public CommentDto map(GithubIssueCommentsResult in) { CommentDto comment = delegate.map(in); if (comment != null) { comment.setUserName(in.getUser().getLogin()); comment.setUserUrl(in.getUser().getUrl()); comment.setUserAvatar(in.getUser().getAvatarUrl()...
CommentDtoMapperDecorator implements CommentDtoMapper { @Override public CommentDto map(GithubIssueCommentsResult in) { CommentDto comment = delegate.map(in); if (comment != null) { comment.setUserName(in.getUser().getLogin()); comment.setUserUrl(in.getUser().getUrl()); comment.setUserAvatar(in.getUser().getAvatarUrl()...
CommentDtoMapperDecorator implements CommentDtoMapper { @Override public CommentDto map(GithubIssueCommentsResult in) { CommentDto comment = delegate.map(in); if (comment != null) { comment.setUserName(in.getUser().getLogin()); comment.setUserUrl(in.getUser().getUrl()); comment.setUserAvatar(in.getUser().getAvatarUrl()...
CommentDtoMapperDecorator implements CommentDtoMapper { @Override public CommentDto map(GithubIssueCommentsResult in) { CommentDto comment = delegate.map(in); if (comment != null) { comment.setUserName(in.getUser().getLogin()); comment.setUserUrl(in.getUser().getUrl()); comment.setUserAvatar(in.getUser().getAvatarUrl()...
@Test public void findAll() { List<Fund> funds = singletonList(FundMother.fndFundFunderKnown().build()); when(fundRepository.findAll()).thenReturn(funds); List<FundDto> expecedFunds = singletonList(FundDtoMother.aFundDto().build()); when(mappers.mapList(Fund.class, FundDto.class, funds)).thenReturn(expecedFunds); List<...
@Transactional(readOnly = true) @Override public List<FundDto> findAll() { return mappers.mapList(Fund.class, FundDto.class, fundRepository.findAll()); }
FundServiceImpl implements FundService { @Transactional(readOnly = true) @Override public List<FundDto> findAll() { return mappers.mapList(Fund.class, FundDto.class, fundRepository.findAll()); } }
FundServiceImpl implements FundService { @Transactional(readOnly = true) @Override public List<FundDto> findAll() { return mappers.mapList(Fund.class, FundDto.class, fundRepository.findAll()); } @Autowired FundServiceImpl(final FundRepository fundRepository, final RefundRepository refundRepo...
FundServiceImpl implements FundService { @Transactional(readOnly = true) @Override public List<FundDto> findAll() { return mappers.mapList(Fund.class, FundDto.class, fundRepository.findAll()); } @Autowired FundServiceImpl(final FundRepository fundRepository, final RefundRepository refundRepo...
FundServiceImpl implements FundService { @Transactional(readOnly = true) @Override public List<FundDto> findAll() { return mappers.mapList(Fund.class, FundDto.class, fundRepository.findAll()); } @Autowired FundServiceImpl(final FundRepository fundRepository, final RefundRepository refundRepo...
@Test public void findAllByIterable() { List<Fund> funds = singletonList(FundMother.fndFundFunderKnown().build()); Set<Long> ids = funds.stream().map(Fund::getId).collect(Collectors.toSet()); when(fundRepository.findAll(ids)).thenReturn(funds); List<FundDto> expecedFunds = singletonList(FundDtoMother.aFundDto().build()...
@Transactional(readOnly = true) @Override public List<FundDto> findAll() { return mappers.mapList(Fund.class, FundDto.class, fundRepository.findAll()); }
FundServiceImpl implements FundService { @Transactional(readOnly = true) @Override public List<FundDto> findAll() { return mappers.mapList(Fund.class, FundDto.class, fundRepository.findAll()); } }
FundServiceImpl implements FundService { @Transactional(readOnly = true) @Override public List<FundDto> findAll() { return mappers.mapList(Fund.class, FundDto.class, fundRepository.findAll()); } @Autowired FundServiceImpl(final FundRepository fundRepository, final RefundRepository refundRepo...
FundServiceImpl implements FundService { @Transactional(readOnly = true) @Override public List<FundDto> findAll() { return mappers.mapList(Fund.class, FundDto.class, fundRepository.findAll()); } @Autowired FundServiceImpl(final FundRepository fundRepository, final RefundRepository refundRepo...
FundServiceImpl implements FundService { @Transactional(readOnly = true) @Override public List<FundDto> findAll() { return mappers.mapList(Fund.class, FundDto.class, fundRepository.findAll()); } @Autowired FundServiceImpl(final FundRepository fundRepository, final RefundRepository refundRepo...
@Test public void getFundsForRequestGroupedByFunder() { final long requestId = 45L; final List<Fund> funds = new ArrayList<>(); final List<Refund> refunds = new ArrayList<>(); final String funder1UserId = "46534-gjh"; final String funder2UserId = "hgfh-676"; final String funder1Address = "0x5346547"; final String funde...
@Override @Transactional(readOnly = true) public FundsForRequestDto getFundsForRequestGroupedByFunder(final Long requestId) { final List<UserFundsDto> userFunds = getFundsAndRefundsFor(requestId); enrichFundsWithZeroValues(userFunds); final TokenValueDto fndFunds = totalFunds(userFunds, UserFundsDto::getFndFunds, UserF...
FundServiceImpl implements FundService { @Override @Transactional(readOnly = true) public FundsForRequestDto getFundsForRequestGroupedByFunder(final Long requestId) { final List<UserFundsDto> userFunds = getFundsAndRefundsFor(requestId); enrichFundsWithZeroValues(userFunds); final TokenValueDto fndFunds = totalFunds(us...
FundServiceImpl implements FundService { @Override @Transactional(readOnly = true) public FundsForRequestDto getFundsForRequestGroupedByFunder(final Long requestId) { final List<UserFundsDto> userFunds = getFundsAndRefundsFor(requestId); enrichFundsWithZeroValues(userFunds); final TokenValueDto fndFunds = totalFunds(us...
FundServiceImpl implements FundService { @Override @Transactional(readOnly = true) public FundsForRequestDto getFundsForRequestGroupedByFunder(final Long requestId) { final List<UserFundsDto> userFunds = getFundsAndRefundsFor(requestId); enrichFundsWithZeroValues(userFunds); final TokenValueDto fndFunds = totalFunds(us...
FundServiceImpl implements FundService { @Override @Transactional(readOnly = true) public FundsForRequestDto getFundsForRequestGroupedByFunder(final Long requestId) { final List<UserFundsDto> userFunds = getFundsAndRefundsFor(requestId); enrichFundsWithZeroValues(userFunds); final TokenValueDto fndFunds = totalFunds(us...
@Test public void getTotalFundsForRequest() { final long requestId = 6457L; final Request request = RequestMother.fundRequestArea51().withStatus(RequestStatus.FUNDED).build(); final IssueInformation issueInformation = request.getIssueInformation(); final String platform = issueInformation.getPlatform().name(); final St...
@Override @Transactional(readOnly = true) @Cacheable(value = "funds", key = "#requestId", unless = "#result.isEmpty()") public List<TokenValueDto> getTotalFundsForRequest(Long requestId) { final Optional<Request> one = requestRepository.findOne(requestId); if (one.isPresent()) { try { if (one.get().getStatus() == Reque...
FundServiceImpl implements FundService { @Override @Transactional(readOnly = true) @Cacheable(value = "funds", key = "#requestId", unless = "#result.isEmpty()") public List<TokenValueDto> getTotalFundsForRequest(Long requestId) { final Optional<Request> one = requestRepository.findOne(requestId); if (one.isPresent()) {...
FundServiceImpl implements FundService { @Override @Transactional(readOnly = true) @Cacheable(value = "funds", key = "#requestId", unless = "#result.isEmpty()") public List<TokenValueDto> getTotalFundsForRequest(Long requestId) { final Optional<Request> one = requestRepository.findOne(requestId); if (one.isPresent()) {...
FundServiceImpl implements FundService { @Override @Transactional(readOnly = true) @Cacheable(value = "funds", key = "#requestId", unless = "#result.isEmpty()") public List<TokenValueDto> getTotalFundsForRequest(Long requestId) { final Optional<Request> one = requestRepository.findOne(requestId); if (one.isPresent()) {...
FundServiceImpl implements FundService { @Override @Transactional(readOnly = true) @Cacheable(value = "funds", key = "#requestId", unless = "#result.isEmpty()") public List<TokenValueDto> getTotalFundsForRequest(Long requestId) { final Optional<Request> one = requestRepository.findOne(requestId); if (one.isPresent()) {...
@Test void hasRefunds_noRefunds() { assertThat(UserFundsDto.builder().build().hasRefunds()).isFalse(); }
public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; }
UserFundsDto { public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } }
UserFundsDto { public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } }
UserFundsDto { public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } boolean hasRefunds(); }
UserFundsDto { public boolean hasRefunds() { return fndRefunds != null || otherRefunds != null; } boolean hasRefunds(); }