Search in sources :

Example 1 with PropertyContext

use of org.apache.nifi.context.PropertyContext in project nifi by apache.

the class ITNiFiAtlasClient method setup.

@Before
public void setup() {
    // Add your atlas server ip address into /etc/hosts as atlas.example.com
    PropertyContext propertyContext = mock(PropertyContext.class);
    when(propertyContext.getProperty(ReportLineageToAtlas.ATLAS_USER)).thenReturn(new MockPropertyValue("admin"));
    when(propertyContext.getProperty(ReportLineageToAtlas.ATLAS_PASSWORD)).thenReturn(new MockPropertyValue("admin"));
    final AtlasAuthN atlasAuthN = new Basic();
    atlasAuthN.configure(propertyContext);
    atlasClient = new NiFiAtlasClient(atlasAuthN.createClient(new String[] { "http://atlas.example.com:21000/" }));
}
Also used : AtlasAuthN(org.apache.nifi.atlas.security.AtlasAuthN) Basic(org.apache.nifi.atlas.security.Basic) PropertyContext(org.apache.nifi.context.PropertyContext) MockPropertyValue(org.apache.nifi.util.MockPropertyValue) Before(org.junit.Before)

Aggregations

AtlasAuthN (org.apache.nifi.atlas.security.AtlasAuthN)1 Basic (org.apache.nifi.atlas.security.Basic)1 PropertyContext (org.apache.nifi.context.PropertyContext)1 MockPropertyValue (org.apache.nifi.util.MockPropertyValue)1 Before (org.junit.Before)1