clean up CommandHandlerProviderTest
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
29d64d3cb0
commit
3ac7c29e51
+8
-11
@@ -18,12 +18,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.commands.provider;
|
package org.apache.fineract.commands.provider;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
import org.apache.fineract.commands.exception.UnsupportedCommandException;
|
import org.apache.fineract.commands.exception.UnsupportedCommandException;
|
||||||
import org.apache.fineract.commands.handler.NewCommandSourceHandler;
|
import org.apache.fineract.commands.handler.NewCommandSourceHandler;
|
||||||
import org.apache.fineract.infrastructure.configuration.spring.TestsWithoutDatabaseAndNoJobsConfiguration;
|
import org.apache.fineract.infrastructure.configuration.spring.TestsWithoutDatabaseAndNoJobsConfiguration;
|
||||||
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
||||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||||
import org.junit.Assert;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -47,18 +48,14 @@ public class CommandHandlerProviderTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void shouldRegisterHandler() {
|
public void shouldRegisterHandler() {
|
||||||
try {
|
final Long testCommandId = 815L;
|
||||||
final Long testCommandId = 815L;
|
|
||||||
|
|
||||||
final NewCommandSourceHandler registeredHandler = this.commandHandlerProvider.getHandler("HUMAN", "UPDATE");
|
final NewCommandSourceHandler registeredHandler = this.commandHandlerProvider.getHandler("HUMAN", "UPDATE");
|
||||||
|
|
||||||
final CommandProcessingResult result =
|
final CommandProcessingResult result =
|
||||||
registeredHandler.processCommand(
|
registeredHandler.processCommand(
|
||||||
JsonCommand.fromExistingCommand(testCommandId, null, null, null, null, null, null, null, null,null,null));
|
JsonCommand.fromExistingCommand(testCommandId, null, null, null, null, null, null, null, null,null,null));
|
||||||
Assert.assertEquals(testCommandId, result.commandId());
|
assertEquals(testCommandId, result.commandId());
|
||||||
} catch (UnsupportedCommandException ucex) {
|
|
||||||
Assert.fail();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = UnsupportedCommandException.class)
|
@Test(expected = UnsupportedCommandException.class)
|
||||||
|
|||||||
Reference in New Issue
Block a user