Skip to content

Commit

Permalink
Removed javabean-tester dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored and slawekradzyminski committed Feb 14, 2019
1 parent 7b86ed0 commit 5e67189
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 14 deletions.
5 changes: 0 additions & 5 deletions fluentlenium-core/pom.xml
Expand Up @@ -67,11 +67,6 @@
<artifactId>byte-buddy</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.hazendaz</groupId>
<artifactId>javabean-tester</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
Expand Down
@@ -1,11 +1,48 @@
package org.fluentlenium.configuration;

import com.codebox.bean.JavaBeanTester;
import static org.assertj.core.api.Assertions.assertThat;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import net.bytebuddy.ByteBuddy;
import org.junit.Before;
import org.junit.Test;

public class ProgrammaticConfigurationTest {

private static final String PARAM = "param";
private static final String VALUE = "value";

private Class<?> clazz;

@Before
public void setUp() {
clazz = new ByteBuddy()
.subclass(ProgrammaticConfiguration.class)
.make()
.load(getClass().getClassLoader())
.getLoaded();
}

@Test
public void testDefaultConfiguration() {
JavaBeanTester.builder(ProgrammaticConfiguration.class).loadData().testInstance(new ProgrammaticConfiguration());
public void testDefaultConfiguration() throws IllegalAccessException,
InstantiationException, NoSuchMethodException, InvocationTargetException {

Object programmaticConfInstance = clazz.getDeclaredConstructor().newInstance();
assertThat(programmaticConfInstance).isInstanceOf(ProgrammaticConfiguration.class);
}

@Test
public void testSetAndGetProperty() throws NoSuchMethodException,
IllegalAccessException, InvocationTargetException, InstantiationException {

Object programmaticConfInstance = clazz.getDeclaredConstructor().newInstance();
Method setCustomProperty = clazz.getMethod("setCustomProperty", String.class, String.class);
Method getCustomProperty = clazz.getMethod("getCustomProperty", String.class);

setCustomProperty.invoke(programmaticConfInstance, new String[]{PARAM, VALUE});
Object param = getCustomProperty.invoke(programmaticConfInstance, PARAM);

assertThat(param).isEqualTo(VALUE);
}
}
6 changes: 0 additions & 6 deletions pom.xml
Expand Up @@ -217,12 +217,6 @@
<version>1.9.7</version>
<scope>compile</scope>
</dependency>
<!--Upgrading to 2.X.X leads to 0 tests being executed in fluentlenium-core for unknown reason-->
<dependency>
<groupId>com.github.hazendaz</groupId>
<artifactId>javabean-tester</artifactId>
<version>1.4.5</version>
</dependency>
<dependency>
<groupId>org.atteo.classindex</groupId>
<artifactId>classindex</artifactId>
Expand Down

0 comments on commit 5e67189

Please sign in to comment.