Advertisement
BoberDiversant

Untitled

May 30th, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1.  protected static void validateCommonParameters(CommonParameters parameters) {
  2.         String COMMON_PARAMETERS = "commonParameters";
  3.         String LOCALE = "locale";
  4.         if (parameters == null || parameters.getLocale() == null || "".equals(parameters.getLocale()))
  5.             throw new ParameterNotFoundException(COMMON_PARAMETERS, LOCALE);
  6.     }
  7.  
  8.     @Test
  9.     void test_validateCommonParameters_fail() {
  10.         CommonParameters commonParameters = new CommonParameters();
  11.         Throwable thrown = assertThrows(ParameterNotFoundException.class,
  12.                 () -> ParametersValidator.validateCommonParameters(commonParameters));
  13.         assertNotNull(thrown.getMessage());
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement