mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 05:01:07 +00:00
SPRINT-12: fixed style issue and broken tests
This commit is contained in:
@ -70,26 +70,6 @@ public class QValueFormatter
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
public String formatDate(LocalDate date)
|
||||
{
|
||||
return (dateFormatter.format(date));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
public String formatDateTime(LocalDateTime dateTime)
|
||||
{
|
||||
return (dateTimeFormatter.format(dateTime));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
@ -149,6 +129,26 @@ public class QValueFormatter
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
public String formatDate(LocalDate date)
|
||||
{
|
||||
return (dateFormatter.format(date));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
public String formatDateTime(LocalDateTime dateTime)
|
||||
{
|
||||
return (dateTimeFormatter.format(dateTime));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Make a string from a table's recordLabelFormat and fields, for a given record.
|
||||
*******************************************************************************/
|
||||
|
@ -25,6 +25,8 @@ package com.kingsrook.qqq.backend.core.actions.dashboard;
|
||||
import java.net.UnknownHostException;
|
||||
import com.kingsrook.qqq.backend.core.exceptions.QException;
|
||||
import com.kingsrook.qqq.backend.core.model.actions.widgets.RenderWidgetInput;
|
||||
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QWidgetMetaData;
|
||||
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.QuickSightChartMetaData;
|
||||
import com.kingsrook.qqq.backend.core.utils.TestUtils;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
@ -42,7 +44,8 @@ class QuickSightChartRendererTest
|
||||
@Test
|
||||
void testWrongMetaDataClass() throws QException
|
||||
{
|
||||
assertThatThrownBy(() -> new QuickSightChartRenderer().render(new RenderWidgetInput(TestUtils.defineInstance())))
|
||||
RenderWidgetInput input = getInput().withWidgetMetaData(new QWidgetMetaData());
|
||||
assertThatThrownBy(() -> new QuickSightChartRenderer().render(input))
|
||||
.hasRootCauseInstanceOf(ClassCastException.class);
|
||||
}
|
||||
|
||||
@ -54,7 +57,8 @@ class QuickSightChartRendererTest
|
||||
@Test
|
||||
void testNoCredentials() throws QException
|
||||
{
|
||||
assertThatThrownBy(() -> new QuickSightChartRenderer().render(new RenderWidgetInput(TestUtils.defineInstance())))
|
||||
RenderWidgetInput input = getInput().withWidgetMetaData(new QuickSightChartMetaData());
|
||||
assertThatThrownBy(() -> new QuickSightChartRenderer().render(input))
|
||||
.hasRootCauseInstanceOf(NullPointerException.class);
|
||||
}
|
||||
|
||||
@ -66,8 +70,28 @@ class QuickSightChartRendererTest
|
||||
@Test
|
||||
void testBadCredentials() throws QException
|
||||
{
|
||||
assertThatThrownBy(() -> new QuickSightChartRenderer().render(new RenderWidgetInput(TestUtils.defineInstance())
|
||||
)).hasRootCauseInstanceOf(UnknownHostException.class);
|
||||
RenderWidgetInput input = getInput().withWidgetMetaData(
|
||||
new QuickSightChartMetaData()
|
||||
.withName("test")
|
||||
.withAccessKey("FAIL")
|
||||
.withSecretKey("FAIL")
|
||||
.withRegion("FAIL")
|
||||
.withAccountId("FAIL")
|
||||
);
|
||||
assertThatThrownBy(() -> new QuickSightChartRenderer().render(input))
|
||||
.hasRootCauseInstanceOf(UnknownHostException.class);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
||||
private RenderWidgetInput getInput()
|
||||
{
|
||||
return (new RenderWidgetInput(TestUtils.defineInstance()).withSession(TestUtils.getMockSession()));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user