Skip to content

Commit

Permalink
TODOs. Slight refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukedegruchy committed Jan 18, 2025
1 parent 4fae950 commit d221217
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@ class BaseMethodBindingMethodParameterBuilder {

private BaseMethodBindingMethodParameterBuilder() {}

static Object[] buildMethodParams(Method theMethod, Object[] theMethodParams)
static Object[] buildMethodParams(Method theMethod, Object[] theMethodParams) {
try {
return tryBuildMethodParams(theMethod, theMethodParams);
} catch (InvocationTargetException | IllegalAccessException | InstantiationException exception) {
throw new InternalErrorException(String.format("%s1234: Error building method params: %s",
Msg.code(234198928), exception.getMessage()), exception);
}
}

static Object[] tryBuildMethodParams(Method theMethod, Object[] theMethodParams)
throws InvocationTargetException, IllegalAccessException, InstantiationException {

if (theMethod == null || theMethodParams == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

// LUKETODO: try to cover more InternalErrorException cases
class BaseMethodBindingMethodParameterBuilderTest {

// LUKETODO: assert Exception messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Mockito.lenient;

// LUKETODO: ask #team-hdp about adding FHIR structures R4 to the test pom
// LUKETODO: test FHIR primitive types, like IntegerType, BooleanType, and IPrimitiveType
// LUKETODO: test IdParam/IIdType/etc
// LUKETODO: test with RequestDetails either at the beginning or the end
// LUKETODO: try to test for every case in embedded params where there's a throws
@ExtendWith(MockitoExtension.class)
class MethodUtilTest {

Expand Down

0 comments on commit d221217

Please sign in to comment.