generated from cuioss/cui-java-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
159 additions
and
3 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
modules/portal-ui-api/src/test/java/de/cuioss/portal/ui/api/GlobalComponentIdsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package de.cuioss.portal.ui.api; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
/** | ||
* Quite nonsense, coverage only | ||
*/ | ||
class GlobalComponentIdsTest { | ||
|
||
@Test | ||
void eachShouldProvideIdentifier() { | ||
for (GlobalComponentIds ids : GlobalComponentIds.values()) { | ||
assertNotNull(ids.getId()); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...rtal-ui-api/src/test/java/de/cuioss/portal/ui/api/exceptions/DefaultErrorMessageTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package de.cuioss.portal.ui.api.exceptions; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import de.cuioss.portal.core.storage.impl.MapStorageImpl; | ||
import de.cuioss.test.valueobjects.ValueObjectTest; | ||
import de.cuioss.test.valueobjects.api.contracts.VerifyConstructor; | ||
|
||
@VerifyConstructor(of = { "errorCode", "errorTicket", "errorMessage", "pageId" }) | ||
class DefaultErrorMessageTest extends ValueObjectTest<DefaultErrorMessage> { | ||
|
||
@Test | ||
void shouldAddToMap() { | ||
var message = anyValueObject(); | ||
var storage = new MapStorageImpl<>(); | ||
DefaultErrorMessage.addErrorMessageToSessionStorage(message, storage); | ||
assertEquals(message, storage.get(DefaultErrorMessage.LOOKUP_KEY)); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
modules/portal-ui-api/src/test/java/de/cuioss/portal/ui/api/ui/Jsf23EnablerBeanTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package de.cuioss.portal.ui.api.ui; | ||
|
||
import de.cuioss.test.valueobjects.junit5.contracts.ShouldBeNotNull; | ||
|
||
class Jsf23EnablerBeanTest implements ShouldBeNotNull<Jsf23EnablerBean> { | ||
|
||
@Override | ||
public Jsf23EnablerBean getUnderTest() { | ||
return new Jsf23EnablerBean(); | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
...rtal-ui-api/src/test/java/de/cuioss/portal/ui/api/ui/context/CurrentViewProducerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package de.cuioss.portal.ui.api.ui.context; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.jboss.weld.junit5.auto.AddBeanClasses; | ||
import org.jboss.weld.junit5.auto.EnableAutoWeld; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import de.cuioss.jsf.api.common.view.ViewDescriptor; | ||
import de.cuioss.test.jsf.junit5.EnableJsfEnvironment; | ||
import de.cuioss.test.valueobjects.junit5.contracts.ShouldBeNotNull; | ||
import lombok.Getter; | ||
|
||
@EnableJsfEnvironment | ||
@EnableAutoWeld | ||
@AddBeanClasses({ CurrentViewProducer.class }) | ||
class CurrentViewProducerTest implements ShouldBeNotNull<ViewDescriptor> { | ||
|
||
@Inject | ||
@CuiCurrentView | ||
@Getter | ||
private ViewDescriptor underTest; | ||
|
||
@Inject | ||
private CurrentViewProducer producer; | ||
|
||
@Test | ||
void shouldHandleCurrentView() { | ||
assertNotNull(producer.getCurrentView()); | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
...st/java/de/cuioss/portal/ui/api/ui/context/CurrentViewProducerTestWOFacesContextTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package de.cuioss.portal.ui.api.ui.context; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.jboss.weld.junit5.auto.AddBeanClasses; | ||
import org.jboss.weld.junit5.auto.EnableAutoWeld; | ||
import org.junit.jupiter.api.Test; | ||
|
||
@EnableAutoWeld | ||
@AddBeanClasses({ CurrentViewProducer.class }) | ||
class CurrentViewProducerTestWOFacesContextTest { | ||
|
||
@Inject | ||
private CurrentViewProducer producer; | ||
|
||
@Test | ||
void shouldHandleCurrentView() { | ||
assertNotNull(producer.getCurrentView()); | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
...-api/src/test/java/de/cuioss/portal/ui/api/ui/lazyloading/BaseLazyLoadingRequestTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package de.cuioss.portal.ui.api.ui.lazyloading; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.jboss.weld.junit5.auto.AddBeanClasses; | ||
import org.jboss.weld.junit5.auto.EnableAutoWeld; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import de.cuioss.portal.ui.api.dashboard.LazyLoadingTestSupportProducer; | ||
import de.cuioss.test.valueobjects.junit5.contracts.ShouldBeNotNull; | ||
import de.cuioss.test.valueobjects.junit5.contracts.ShouldImplementEqualsAndHashCode; | ||
import lombok.Getter; | ||
|
||
@EnableAutoWeld | ||
@AddBeanClasses({ LazyLoadingTestSupportProducer.class, TestBaseLazyLoadingRequest.class }) | ||
class BaseLazyLoadingRequestTest implements ShouldBeNotNull<TestBaseLazyLoadingRequest>, | ||
ShouldImplementEqualsAndHashCode<TestBaseLazyLoadingRequest> { | ||
|
||
@Inject | ||
@Getter | ||
private TestBaseLazyLoadingRequest underTest; | ||
|
||
@Test | ||
void shouldDelegateHappyCase() { | ||
|
||
assertDoesNotThrow(() -> underTest.getRequestId()); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...-api/src/test/java/de/cuioss/portal/ui/api/ui/lazyloading/TestBaseLazyLoadingRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package de.cuioss.portal.ui.api.ui.lazyloading; | ||
|
||
import de.cuioss.uimodel.result.ResultObject; | ||
|
||
public class TestBaseLazyLoadingRequest extends BaseLazyLoadingRequest<String> { | ||
|
||
@Override | ||
public ResultObject<String> backendRequest() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void handleResult(String result) { | ||
|
||
} | ||
|
||
} |