Source:
<code>private void prepareDataDirectory(SystemTestData testData) throws Exception { Catalog catalog = getCatalog(); <START> catalog.setDefaultWorkspace(getCatalog().getWorkspaceByName(BASIC_POLYGONS.getPrefix())); <END> testData.addWorkspace(TEST_WORKSPACE_NAME, TEST_WORKSPACE_URI, catalog); WorkspaceInfo wi = catalog.getWorkspaceByName(TEST_WORKSPACE_NAME); testData.addStyle( wi, WORKSPACED_STYLE_NAME, WORKSPACED_STYLE_FILE, this.getClass(), catalog); assertThat( catalog.getStyleByName(wi, WORKSPACED_STYLE_NAME), Matchers.describedAs( "Style %0 should be in workspace %1.", (not(nullValue())), WORKSPACED_STYLE_NAME, TEST_WORKSPACE_NAME)); Map<LayerProperty, Object> props = new HashMap<>(); props.put(LayerProperty.STYLE, WORKSPACED_STYLE_NAME); testData.addVectorLayer(WORKSPACED_LAYER_QNAME, props, this.getClass(), catalog); LayerInfo li = catalog.getLayerByName(getLayerId(WORKSPACED_LAYER_QNAME)); li.setDefaultStyle(catalog.getStyleByName(wi, WORKSPACED_STYLE_NAME)); catalog.save(li); createLayerGroup(SIMPLE_LAYER_GROUP, MockData.BUILDINGS, MockData.BRIDGES); GWC.get().getConfig().setDirectWMSIntegrationEnabled(false); props = new HashMap<>(); props.put(LayerProperty.SRS, "4326"); props.put(LayerProperty.PROJECTION_POLICY, ProjectionPolicy.FORCE_DECLARED); testData.addVectorLayer( BASIC_POLYGONS_NO_CRS, null, "BasicPolygonsNoCrs.properties", this.getClass(), catalog); testData.addStyle("stylegroup", "stylegroup.sld", GWCIntegrationTest.class, catalog); final LayerGroupInfo group = catalog.getFactory().createLayerGroup(); group.getLayers().add(null); group.getStyles().add(catalog.getStyleByName("stylegroup")); group.setName("stylegroup"); new LayerGroupHelper(group).calculateBounds(); catalog.add(group); HttpRequestRecorderCallback.reset(); }</code><technical_language>need this default in a test workspace services</technical_language>

Target:
private void prepareDataDirectory(SystemTestData testData) throws Exception { Catalog catalog = getCatalog(); testData.addWorkspace(TEST_WORKSPACE_NAME, TEST_WORKSPACE_URI, catalog); WorkspaceInfo wi = catalog.getWorkspaceByName(TEST_WORKSPACE_NAME); testData.addStyle( wi, WORKSPACED_STYLE_NAME, WORKSPACED_STYLE_FILE, this.getClass(), catalog); assertThat( catalog.getStyleByName(wi, WORKSPACED_STYLE_NAME), Matchers.describedAs( "Style %0 should be in workspace %1.", (not(nullValue())), WORKSPACED_STYLE_NAME, TEST_WORKSPACE_NAME)); Map<LayerProperty, Object> props = new HashMap<>(); props.put(LayerProperty.STYLE, WORKSPACED_STYLE_NAME); testData.addVectorLayer(WORKSPACED_LAYER_QNAME, props, this.getClass(), catalog); LayerInfo li = catalog.getLayerByName(getLayerId(WORKSPACED_LAYER_QNAME)); li.setDefaultStyle(catalog.getStyleByName(wi, WORKSPACED_STYLE_NAME)); catalog.save(li); createLayerGroup(SIMPLE_LAYER_GROUP, MockData.BUILDINGS, MockData.BRIDGES); GWC.get().getConfig().setDirectWMSIntegrationEnabled(false); props = new HashMap<>(); props.put(LayerProperty.SRS, "4326"); props.put(LayerProperty.PROJECTION_POLICY, ProjectionPolicy.FORCE_DECLARED); testData.addVectorLayer( BASIC_POLYGONS_NO_CRS, null, "BasicPolygonsNoCrs.properties", this.getClass(), catalog); testData.addStyle("stylegroup", "stylegroup.sld", GWCIntegrationTest.class, catalog); final LayerGroupInfo group = catalog.getFactory().createLayerGroup(); group.getLayers().add(null); group.getStyles().add(catalog.getStyleByName("stylegroup")); group.setName("stylegroup"); new LayerGroupHelper(group).calculateBounds(); catalog.add(group); HttpRequestRecorderCallback.reset(); }