io.github.jhipster.registry.utils.TestUtils Java Examples

The following examples show how to use io.github.jhipster.registry.utils.TestUtils. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LoggerVMTest.java    From flair-registry with Apache License 2.0 5 votes vote down vote up
@Test
public void toStringTestTest() throws Exception {
    Logger logger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
    LoggerVM vm = new LoggerVM(logger);
    assertTrue(vm.toString().startsWith(LoggerVM.class.getSimpleName()));
    String json = vm.toString().replace(LoggerVM.class.getSimpleName(), "");
    assertTrue(TestUtils.isValid(json));
}
 
Example #2
Source File: LoginVMTest.java    From flair-registry with Apache License 2.0 5 votes vote down vote up
@Test
public void toStringTest(){
    LoginVM vm = new LoginVM();

    assertTrue(vm.toString().startsWith(LoginVM.class.getSimpleName()));
    String json = vm.toString().replace(LoginVM.class.getSimpleName(), "");
    assertTrue(TestUtils.isValid(json));

    vm = new LoginVM();
    vm.setUsername("fakeUsername");
    vm.setPassword("fakePassword");
    vm.setRememberMe(true);
    json = vm.toString().replace(LoginVM.class.getSimpleName(), "");
    assertTrue(TestUtils.isValid(json));
}
 
Example #3
Source File: UserVMTest.java    From flair-registry with Apache License 2.0 5 votes vote down vote up
@Test
public void toStringTest() throws Exception {
    UserVM vm = new UserVM();

    assertTrue(vm.toString().startsWith(UserVM.class.getSimpleName()));
    String json = vm.toString().replace(UserVM.class.getSimpleName(), "");
    assertTrue(TestUtils.isValid(json));

    Set<String> set = new HashSet<>();
    set.add("authorities1");
    set.add("authorities2");
    vm = new UserVM("fakeLogin",set);
    json = vm.toString().replace(UserVM.class.getSimpleName(), "");
    assertTrue(TestUtils.isValid(json));
}
 
Example #4
Source File: LoggerVMTest.java    From jhipster-microservices-example with Apache License 2.0 5 votes vote down vote up
@Test
public void toStringTestTest() throws Exception {
    Logger logger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
    LoggerVM vm = new LoggerVM(logger);
    assertTrue(vm.toString().startsWith(LoggerVM.class.getSimpleName()));
    String json = vm.toString().replace(LoggerVM.class.getSimpleName(), "");
    assertTrue(TestUtils.isValid(json));
}
 
Example #5
Source File: LoginVMTest.java    From jhipster-microservices-example with Apache License 2.0 5 votes vote down vote up
@Test
public void toStringTest(){
    LoginVM vm = new LoginVM();

    assertTrue(vm.toString().startsWith(LoginVM.class.getSimpleName()));
    String json = vm.toString().replace(LoginVM.class.getSimpleName(), "");
    assertTrue(TestUtils.isValid(json));

    vm = new LoginVM();
    vm.setUsername("fakeUsername");
    vm.setPassword("fakePassword");
    vm.setRememberMe(true);
    json = vm.toString().replace(LoginVM.class.getSimpleName(), "");
    assertTrue(TestUtils.isValid(json));
}
 
Example #6
Source File: UserVMTest.java    From jhipster-microservices-example with Apache License 2.0 5 votes vote down vote up
@Test
public void toStringTest() throws Exception {
    UserVM vm = new UserVM();

    assertTrue(vm.toString().startsWith(UserVM.class.getSimpleName()));
    String json = vm.toString().replace(UserVM.class.getSimpleName(), "");
    assertTrue(TestUtils.isValid(json));

    Set<String> set = new HashSet<>();
    set.add("authorities1");
    set.add("authorities2");
    vm = new UserVM("fakeLogin",set);
    json = vm.toString().replace(UserVM.class.getSimpleName(), "");
    assertTrue(TestUtils.isValid(json));
}
 
Example #7
Source File: LoginVMTest.java    From jhipster-registry with Apache License 2.0 5 votes vote down vote up
@Test
public void toStringTest() {
    LoginVM vm = new LoginVM();

    assertThat(vm.toString()).startsWith(LoginVM.class.getSimpleName());
    String json = vm.toString().replace(LoginVM.class.getSimpleName(), "");
    assertThat(TestUtils.isValid(json)).isTrue();

    vm = new LoginVM();
    vm.setUsername("fakeUsername");
    vm.setPassword("fakePassword");
    vm.setRememberMe(true);
    json = vm.toString().replace(LoginVM.class.getSimpleName(), "");
    assertThat(TestUtils.isValid(json)).isTrue();
}
 
Example #8
Source File: UserVMTest.java    From jhipster-registry with Apache License 2.0 5 votes vote down vote up
@Test
public void toStringTest() {
    UserVM vm = new UserVM();

    assertThat(vm.toString()).startsWith(UserVM.class.getSimpleName());
    String json = vm.toString().replace(UserVM.class.getSimpleName(), "");
    assertThat(TestUtils.isValid(json)).isTrue();

    Set<String> authorities = new HashSet<>();
    authorities.add("authorities1");
    authorities.add("authorities2");
    vm = new UserVM("fakeLogin", authorities);
    json = vm.toString().replace(UserVM.class.getSimpleName(), "");
    assertThat(TestUtils.isValid(json)).isTrue();
}
 
Example #9
Source File: ParameterizedErrorVMTest.java    From flair-registry with Apache License 2.0 4 votes vote down vote up
@Test
public void isSerializable() {
    assertTrue(TestUtils.isSerializable(new ParameterizedErrorVM(null, null)));
}
 
Example #10
Source File: ParameterizedErrorVMTest.java    From jhipster-microservices-example with Apache License 2.0 4 votes vote down vote up
@Test
public void isSerializable() {
    assertTrue(TestUtils.isSerializable(new ParameterizedErrorVM(null, null)));
}
 
Example #11
Source File: ParameterizedErrorVMTest.java    From jhipster-registry with Apache License 2.0 4 votes vote down vote up
@Test
public void isSerializable() {
    assertThat(TestUtils.isSerializable(new ParameterizedErrorVM(null, null))).isTrue();
}