gitgabrio commented on code in PR #6138:
URL:
https://github.com/apache/incubator-kie-drools/pull/6138#discussion_r1819017310
##########
drools-compiler/src/test/java/org/drools/compiler/lang/descr/CompositePackageDescrTest.java:
##########
@@ -50,20 +51,22 @@ public void addPackageDescrSamePkgUUID() {
assertThat(compositePackageDescr.getPreferredPkgUUID().get()).isEqualTo(pkgUUID);
}
- @Test(expected = RuntimeException.class)
+ @Test
public void addPackageDescrDifferentPkgUUID() {
- String pkgUUID = generateUUID();
- PackageDescr first = new PackageDescr(NAMESPACE);
- first.setPreferredPkgUUID(pkgUUID);
- assertThat(first.getPreferredPkgUUID().isPresent()).isTrue();
- compositePackageDescr.addPackageDescr(new ByteArrayResource(), first);
-
assertThat(compositePackageDescr.getPreferredPkgUUID().isPresent()).isTrue();
-
assertThat(compositePackageDescr.getPreferredPkgUUID().get()).isEqualTo(pkgUUID);
- pkgUUID = generateUUID();
- PackageDescr second = new PackageDescr(NAMESPACE);
- second.setPreferredPkgUUID(pkgUUID);
- assertThat(second.getPreferredPkgUUID().isPresent()).isTrue();
-
assertThat(second.getPreferredPkgUUID().get()).isNotEqualTo(first.getPreferredPkgUUID().get());
- compositePackageDescr.addPackageDescr(new ByteArrayResource(), second);
+ assertThrows(RuntimeException.class, () -> {
Review Comment:
HI @pibizza
I'm not convinced by those nested asserts: I think it would be better to
extract `PackageDescr` instantiation outside the `assertThrows`, to make
clearer the context of those assertions
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]